DEV Community

Discussion on: useState or const: what's the difference?

Collapse
 
dechamp profile image
DeChamp • Edited

I'll bite... useState should be used with [needsTacos, setNeedsTacos] first off... since the whole purpose is to be able to manage the state. One is a constant value which never changes. So I feel like this is a trick question or I totally misunderstood it.

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes

Right? I havent found a reason to use

const [variableOnly] = useState()

or

 const [,setterOnly] = useState()

I just thought it was a fun thinking exercise.

Collapse
 
dechamp profile image
DeChamp

It is a fun thinking exercise, because I was racking my brain to see if i was missing something. It also leads in to letting others know that, yes you may think it's an option, but it's not the proper use. So maybe someone will see this and have the questions answered. Thumbs up!