This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const News = props => { | |
const changeTitle = () => { | |
// Since props are read-only, you are not allowed to do so | |
props.changeTitle("Title changed!"); | |
}; | |
return ( | |
<div> | |
<h1>{props.title}</h1> | |
<div>{props.content}</div> | |
<button onClick={changeTitle}>Mutate!</button> |
NewerOlder