DEV Community

Discussion on: Why useState??? and Some important basic things of React useState Hook,I have noticed....

Collapse
 
pengeszikra profile image
Peter Vivo
const [fooObject, setFooObject] = useState({});
Enter fullscreen mode Exit fullscreen mode

useState return two elements array give free to declare state and action ( value / setter ) names, in one step;

Collapse
 
riyadmahmud2021 profile image
Riyad Mahmud

Thanks,
I have told here, " such an state and state updating function. " .
I think updating means not only increment or decrement a state but also new value setting in a state.