Closed (fixed)
Project:
Decoupled Layout Builder Pitchburgh Packages
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
19 Jul 2023 at 05:08 UTC
Updated:
15 Nov 2023 at 02:29 UTC
Jump to comment: Most recent
Each of the component types discussed will likely need to access some context in relation to their current data and the current entity.
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
Comment #2
griffynh commentedComment #3
griffynh commentedComment #4
griffynh commentedComment #5
larowlanWe 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...