Created
June 26, 2020 14:49
-
-
Save argodeep/b82806f64207b0a7508d8f6181700b52 to your computer and use it in GitHub Desktop.
React Hooks
This file contains hidden or 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
| // Functional component | |
| function Filter(props) { | |
| const [keyword, setKeyword] = useState(''); | |
| console.log(props) | |
| // ... | |
| } | |
| // class based component | |
| class Filter extends Component { | |
| constructor(props) { | |
| super(props) | |
| this.state = { keyword: '' } | |
| console.log(this.props) | |
| } | |
| // ... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment