Is there a way to render multiple React components in the React.render() function?

后端 未结 8 1228
无人共我
无人共我 2020-12-08 06:33

For example could I do:

import React from \'react\';
import PanelA from \'./panelA.jsx\';
import PanelB from \'./panelB.jsx\';

React.render( 
  

        
8条回答
  •  感情败类
    2020-12-08 07:02

    this.propsTextBox.value = this._context.parameters.textBoxProperty.raw || "";
    var elements = new Array>();
    elements.push(React.createElement(
                    TextField, 
                    this.propsTextBox
                ));
    elements.push(React.createElement(
        Label, 
        this.propsLabel
    ));
    
    ReactDOM.render(
        elements,  
        this._container
    );
    

提交回复
热议问题