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

FULL DISCUSSION
 

// 1. needsTacos "can" trigger re-render.
// 2. needsTacos doesn't trigger re-render (same goes for ref by useRef)

 

Wouldn't you need a "setNeedsTacos" to trigger a re-render?

 

Yes, you are right, Ryan.

Updating the state using setNeedsTacos "can" cause the re-render.

code of conduct - report abuse