This video is available to students only
- The newline Guide to Modernizing an Enterprise React App
- Refactor React Classes to React Hooks
Refactor ProductForm.js
Ah forms, a painful Achilles heel of most web applications (React apps included) since the beginning of time.
This page is a preview of The newline Guide to Modernizing an Enterprise React App
- ProductForm.js isn't as complicated as its many inputs make it seem
- Convert ProductForm to a functional component and remove the render method
- Replace class state with useState Hooks
- Switch out the componentDidMount fetching departments for a useEffect
- Update our other class functions into arrow functions
- Refactor onChange to an arrow function
Contents