The main difference between state and props is that props are immutable, while state can change based on user interaction.

React Props syntax

The main difference between state and props is that props are immutable, while state can change based on user interaction.

React Props example

var HelloMessage = React.createClass({
  render: function() {
    return <h1>Hello {this.props.name}</h1>;  }}); 
ReactDOM.render(
  <HelloMessage name="php.cn" />,  document.getElementById('example')