OK say I have a backdraftjs component Box
class Box extends Component {
bdElements() {
return e.div(
{style: border: "1px solid black"},
);
}
}
and another Jack
class Jack extends Component {
bdElements() {
return e.h1(
'hello my name is Jack'
);
}
}
Is there a way to create a component that puts Jack in Box?
class JackInBox extends Component {
bdElements() {
????
}
}
I don't think that's possible, is it?
You can pass custom components as a child similar to how you pass normal elements. eg.
In your code
e.div(...)
is a shortcut fore("div", ...)
. You can pass a your custom component instead of"div"
.By default children passed to a component are appended to the root element of the component.