--

Of course not, hooks by definition are not pure functional. React created hooks to handle all the impurities. There is no a stateless hook.

Citing the definition from React docs: «Hooks allow you to reuse stateful logic without changing your component hierarchy.» So, they are indeed non-functional by definition.

But... what you say concerns me. It seems that people understood it wrong that hooks are functional. Which in my heart is something painful. I hope that people would realize that hooks were created to deal with impurity.

--

--

David Rodenas PhD
David Rodenas PhD

Written by David Rodenas PhD

Passionate software engineer & storyteller. Sharing knowledge to advance our skills. Join me on a journey of discovery in the world of software engineering.

Responses (1)