empty arrow function inside useState in react

Viewed 1422

why some people use an empty arrow function in useState like this const [email, setEmail] = useState(() => {})?

Any kind of help would be appreciated

1 Answers

They are setting the email to an object which its value will later be set using another function. Try read more about Hooks Here

Related