<Multiply a="4" b="2" /> // => 8const multiply = (a, b) => { // <-- Props
const product = a * b // <-- State
return product
}<Square n="4" /> // ==> 16class Square extends Component {
render () {
return <Multiply a={this.props.n} b={this.props.n} />
}
}const square = (n) => { // <-= props
const product = multiply(n, n) // <-- state
return product
}// multiply(4, 2) // => 8Props are just like parameters/arguments to a function State is like internal variables scoped to a function