In this article, we are going to look at how we can use Recoil’s atom, selector, and hooks to display and update a list of employees. The employees are either manager or non-manager. We will update the
isManager field in the application state and see how only the selected column from the row is re-rendered. We will also derive a
count element from the state and see how its UI is re-renderd automatically when the application state is updated.
Recoil documentation for atom states below.
An atom represents state in Recoil. The
atom()function returns a writeable
Note: all atom values are frozen. …
We use React so that it can optimally update the DOM for us using it’s magic. But understanding and using React correctly is of great importance as then only we can gain its benefits else we are stuck with performance problem for our application.
In this article we will be going through a scenario where, on update, we will be re-rendering a list of employees using: