React无法将props传递给createElement,对象作为React子句无效

时间:2017-09-19 15:05:07

标签: reactjs

您好我正在尝试传递简单的字符串作为道具,但反应告诉我它的对象。 这是我的代码,

import RuleForm from './ruleForm'

我的州,

child: RuleForm,
children:[]

和我的componentDidMount:

this.setState({   children:this.state.children.concat(React.createElement(this.state.child),
                    {color: 'blue', shadowSize: 2},
                    'Click Me'
                )
            }) 

0 个答案:

没有答案