You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
If a wp-context directive is nested under another wp-context instance, the properties defined in the parent context should also be available inside the nested context.
constWpContextExample=()=>{constcontextA={a: 'foo'};constcontextB={b: 'bar'};return(<divwp-context={JSON.stringify(contextA)}><divwp-context={JSON.stringify(contextB)}>{/* `context.a` and `context.b` should be accessible here */}</div><div>
);
}
Right now, only context.b is accessible in that scope because contextB replaces contextA entirely.
We need to implement wp-context so that all the previous properties that don't collide are preserved, even when they are nested.
In addition, we need to agree on how Array objects would be merged. We can either append the elements or replace them according to their index.