React Js – Understanding useState’s initial value

If you’re coming over from React’s class components, you might be confused about how useState works, particularly since you can now define what the initial value is.

const [someState, setSomeState] = useState(‘starting value’);

https://maxrozen.com/how-to-use-react-usestate-hook-initial-value/

B logbook : PHP | Javascript | Laravel | CodeIgniter | VueJs | ReactJs | WordPress

Translate »