question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested editor components

See original GitHub issue

Is your feature request related to a problem? Please describe. I have been trying to create a page editor, and everything has been great so far, except for allowing the user to customize the header in the same UI as any other page. The header UI loads successfully but no changes are possible as such.

Describe the solution you’d like Any way to nest <Editor/>, or <Frame data={} /> to allow for dynamic rendering of subcomponents such as header/footer

Additional context Here is my current implementation : <Editor resolver={Resolvers} > <Grid celled className='full-height admin-panel'> <GridColumn className='sideMenu' width='13'> <Fade transitionDuration={transition} show={menuJsonData}> <Editor enabled={true} resolver={Resolvers}> <Frame data={menuJsonData}> <Element is={Container} className='full-height flex-cont' canvas> <div className='full-height red'> <Header as='h2' icon> <Icon name='add circle' /> <HeaderContent>Add content here</HeaderContent> </Header> <div> </div> </div> </Element> </Frame> </Editor> </Fade> <Frame> <Element is={Container} className='full-height flex-cont' canvas> <div className='full-height red'> <Header as='h2' icon> <Icon name='add circle' /> <HeaderContent>Add content here</HeaderContent> </Header> <div> </div> </div> </Element> </Frame> </GridColumn> <GridColumn className='sideMenu' width='3'> <SettingsPanel></SettingsPanel> <Toolbox slug={slug}></Toolbox> </GridColumn> </Grid> </Editor>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
hugominascommented, Aug 24, 2021

Yap that’s how we handle it. We have global application state using one of the mentioned options and each component updates itself when this changes. So you can fetch the data on page load from an endpoint, update the global state without the need to pass things down the component tree. react-hooks-global-state is a good starting point! hope it works out for you

0reactions
pepas24commented, Aug 24, 2021

@hugominas Yes, I understand that is out of the scope of Craft.js but can you point me out with an example or some reference on how to solve this kind of problems? I mean, the Header component in the last example expect some props, but if that props are in the serialized state of Craft I can’t pass down to it because the state was loaded from <Frame data={data} />. I was trying to fetch the categories from the component itself but feels like an antipatern. I’m new on React so I don’t use Redux but I will take a look at react-hooks-global-state as you mention. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step 10: Use Nested Components with In-Line Editing
In this step you will review how the Oracle Content Management Image, Paragraph, and Title components are rendered in your custom component. A...
Read more >
Working with nested SketchUp components - FineWoodworking
The nested component can be treated as single object or you can open the nest and get to the components inside and if...
Read more >
How Do You Make Nested Components in Figma?
To edit a nested component, simply double-click on it in the library. This will open up the parent component in the editor, and...
Read more >
Creating nested components - Avonni Help Center
An Avonni Builder project can contain as many components as you want. Then, it's very easy to use nested components on your project....
Read more >
Angular managing state of nested components - Stack Overflow
simple version: Add an id to your inline-editor. Then create a service and have it manage a BehaviourBubject in which you save the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found