3 ms·
> Most importantly: hooks make functions that look pure actually impure. What makes the functions look pure? Functions in JavaScript have no guarantees about p
by rimunroe 4y ago
> Most importantly: hooks make functions that look pure actually impure.
What makes the functions look pure? Functions in JavaScript have no guarantees about purity. TypeScript won't let you make such guarantees either, and I think Flow won't either. The only way I could imagine something _looks_ pure is if you have prior expectations of what a function component should be from how they were discussed in very old versions of React before APIs like createRef existed. The preferred terminology from the core team these days is "function components" and has been for a long time. I've been using React since 2014 and they stopped talking about "stateless functional components" well before hooks were announced in 2018.