There is no preference when using hooks, but they are not the same.
Both function declarations function Name() {} and function expressions const Name = () => {}; are perfectly fine when using React hooks. The main difference is that function declarations are hoisted (moved) to the top of their scope, see here for an explanation.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There is no preference when using hooks, but they are not the same.
Both function declarations
function Name() {}
and function expressionsconst Name = () => {};
are perfectly fine when using React hooks. The main difference is that function declarations are hoisted (moved) to the top of their scope, see here for an explanation.