Grokking React Fundamentals
Vote

0% completed

​

A Look at React's Best Practices

Code that works is not yet code that is easy to change. A component can render the right output today and still be hard to read, hard to test, and hard to fix when it breaks next month. The habits below make that later work easier, and each one is shown on a small example that you can run.

1. Write function components, not class components

Before hooks were added to React, a component that held state had to be a JavaScript class. Hooks gave function components state and effects, and the React documentation now recommends function components for all new code

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content