Answer the question
In order to leave comments, you need to log in
Question about props?
Is it correct to pass plural properties in this way ?
var User = React.createClass({
getInitialState: function(){
return {
name: 'Jack London',
listTitle: 'Grate List of Friends',
friends: ['Oscar Wilde','Dan Braun', 'Bram Stoker']
}
},
render: function(){
return (
<div>
<h1>{this.state.name}</h1>
<FriendList names={this.state.listTitle} mainName={this.state.name} anotherProp={this.state.prop}/>
</div>
)
}
});
var FriendList = React.createClass({
render: function(){
return (
<div>
<h3>{this.props.mainName}</h3>
<h3>{this.props.names}</h3>
<h3>{this.props.anotherProp}</h3>
</div>
)
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question