re: useState or const: what's the difference? VIEW POST

FULL DISCUSSION
 

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.

 

Right? I havent found a reason to use

const [variableOnly] = useState()

or

 const [,setterOnly] = useState()

I just thought it was a fun thinking exercise.

 

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!

code of conduct - report abuse