Optimize App Performance Using useMemo
What is useMemo ? useMemo is a hook in react-native that will return the memorized value. The most common advantage to use the useMemo is to optimize the performance of the react-native application. How it works? The useMemo will takes two arguments. In the first argument, you have to pass the function and in the second argument, you have to pass the array of dependencies. useMemo will recompute the memorized values once one of the dependencies has changed. Whenever the state is changed in the react-native the component re-render itself. In react-native some-times, we have functions that have expensive calculations code. Once the state has updated the react-native component will call the render and the function will be called again and do the calculation even if the state has no effect on that method. Using useMemo we can resolve the above issue. Impact of useMemo in application performance Using useMemo you can avoid expensive calculations on every render, Which will help you to boo