5

10 Best Practices for Every React Developer

 2 years ago
source link: https://hackernoon.com/10-best-practices-for-every-react-developer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

10 Best Practices for Every React Developer

4
React is one of the most popular front-end libraries for JavaScript. It offers numerous great features, but as we know everything has pros and cons. In this article, we will be discussing how to get the most out of React library and what steps should be taken. component should have Single responsibility. Separate application state logic and presentation in the different components. Minimize the use of state by declaring it only when necessary. Try to utilise Hooks.You can use React.useMemo or React.useCallback for performance optimization.But Consider, React.memo should only be applied to pure components. You should not be using React.useMemo and React.useCallback without measuring.Use Key props.Avoid using Indexes or any duplicate value as Key props.Before adding additional libraries know what inbuilt feature react offers. Write tests.avoid memory leaks in an application

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK