如何将多个状态传递给setState
?下面是一个例子:
getInitialState: function() {
return {
list: [],
newFilm: {},
searchWord: '',
searchDetails: {}
}
},
componentDidMount: function() {
this.setState({
searchDetails:someData,
newFilm: 'I am first text',
})
}
问题是:
该示例在语法上是否正确?