4 Examples of the useState Hook

added by JavaScript Kicks
10/30/2018 4:00:24 AM

991 Views

Up until now, if you started writing a function component and then ran into a situation where you needed to add state, you'd have to convert the component to a class. Write out class Thing extends React.Component, copy the function body into the render() method, fix the indentation, and finally add your state.


0 comments