DEV Community

[Comment from a deleted post]
Collapse
 
nickytonline profile image
Nick Taylor • Edited

useState is meant for saving state when using a function to create a component. If you are using a class, the old way still holds. I recommend checking the Hooks proposal documentation out and check out Ryan Florence 90% Cleaner React talk from ReactConf2018