This addresses the problem of the component being unmounted when switching between views in the block editor. Its state is lost if you change the attributed authors but haven't saved the post.
This change switches to storing an array of Option objects in the state and only using the IDs for storing in the post attribute. This unfortunately means a REST API lookup to fetch the user objects.
This fixes the immediate problem, but I'll follow up with a separate issue to see if we can use the _embed response from the post object when the editing screen first loads to at least avoid the initial REST API request.
See #37
This addresses the problem of the component being unmounted when switching between views in the block editor. Its state is lost if you change the attributed authors but haven't saved the post.
This change switches to storing an array of
Option
objects in the state and only using the IDs for storing in the post attribute. This unfortunately means a REST API lookup to fetch the user objects.This fixes the immediate problem, but I'll follow up with a separate issue to see if we can use the
_embed
response from the post object when the editing screen first loads to at least avoid the initial REST API request.