Tuesday, 6 October, 2020 UTC


Summary

For function components, the `useState` hook is how you make your component stateful. This replaces the previous convention from class components where values were stored in a `this.state` object and manipulated using `this.setState()`. The hook returns an array with two values: the state value your are storing and a function that allows you to updated it. When instantiating the hook, the initial state value is determined by whatever value you pass it. ```jsx const [value, setValue] = useState(null) ```