I've been using scalajs-react for a couple of weeks and so far I've never used the "children" parameter of ReactComponentC.apply() because my children ReactNodes are usually conditionally defined in c.backend.render(). Am I doing something wrong? I there an advantage with passing the children nodes in ReactComponentC.apply()? I there any way to modify this children list dynamically after ReactComponentC.apply() has been run?
Basically I'm just wondering what's the advantage of passing a child to ReactComponentB versus creating an instance of ReactComponentB within the render method of the father component. For instance:
class Backend($: BackendScope[Props, State]) { //The backend class of the father
def render(p: Props, s: State) = {
ReactComponentB("Child") //I create the child directly in the render method (I didn't pass it as a Child.Varargs)
}
}