DEV Community

Discussion on: Why You Should be Writing Your Own React Hooks

Collapse
 
seanmclem profile image
Seanmclem

Does the setter function return a value? You know, in addition to setting one

Thread Thread
 
namick profile image
nathan amick

Oh, right. No, it doesn't return a useful value (undefined). However, it does automagically update the value of the state variable and cause your component to rerender with that new value.