Skip to content

How to register nested custom components? #20

Closed Answered by optimajet
shishir-korde-tech9 asked this question in Q&A
Discussion options

You must be logged in to vote

As you can see from my code of subsection builder, I have already registered children: node props. But how can I supply those children nodes so the json looks like what you've shown? or is this what you meant by no restriction?

This is just a component with two node props. There are no default value for the node annotation. So you can do something like this:

const SubSection = (props: any) => {
  return <div {...props}>SubSection</div>
}

const subSection = define(SubSection, 'SubSection')
  .name('SubSection')
  .props({

  })

const Section = (props: any) => {
  const {subsection1, subsection2} = props
  // defaults
  const s1 = subsection1 ?? <SubSection style={{backgroundColor: 'green'

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@shishir-korde-tech9
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sergeythrees
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants