DEV Community

Discussion on: Why to use useState in react?

Collapse
 
alekseiberezkin profile image
Aleksei Berezkin

To get React without useState or state management:

  1. Store your data in refs
  2. Store DOM elements in refs as well
  3. Update both data and DOM in event handlers
  4. Well... Do you need React here?
Collapse
 
aasthapandey profile image
Aastha Pandey

If one wants to get React without useState or state management go for it , but then there is no point in using react.
For the last point "Well... Do you need React here?"
In the entire post I didn't mention that for DOM manipulation one should use "React", one can use anything according to their use case.