Created
December 7, 2018 17:55
-
-
Save tbranyen/a9cf08620f1402a0c6e2c7ec29e9be96 to your computer and use it in GitHub Desktop.
React Hooks in a Class
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
import { useState, Component } from 'react'; | |
class MyComponent extends Component { | |
render() { | |
const [ count, setCount ] = this.state; | |
return ( | |
<div>{count}</div> | |
); | |
} | |
state = useState(0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment