Background

Each of the component types discussed will likely need to access some context in relation to their current data and the current entity.

Proposed resolution

To allow blocks/layouts/widgets/formatters to access this data without passing down props from each component, create a series of context providers and hooks to allow components to access and update this data.

We can take inspiration from, e.g. useBlockProps in @wordpress/block-editor

Comments

griffynh created an issue. See original summary.

griffynh’s picture

Issue summary: View changes
griffynh’s picture

Issue summary: View changes
griffynh’s picture

larowlan’s picture

Status: Active » Fixed

We ended up handling this with Redux toolkit so we get support for things like undo/redo

https://project.pages.drupalcode.org/decoupled_lb/?path=/docs/components...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.