News for hackers. Stuff that matters.
Re:A Critique of React Hooks Addendum by searchableguy on Thursday May 07, 2020 @11:56AM (#23104449)
Maybe. I really don't know.

There are some places where functionality is dependent on hooks.

React fast refresh won't work with class components. (useState is the hook alternative to class style state management and fast refresh is fancy hot reloading but with persisted state and only reloading modified modules/components).

There are few escape hatches only built as hooks mostly for improving performance issues which weren't previously available. But most of the hooks are basically reimplementation of features from class style components.

There are differences in how hooks work though. Hooks are executed as they are laid out.

Previous life cycle methods were dumped into a single useEffect hook.

It's easy to change hooks and introduce separation in how you build your logic is what I assume they might be referring to.

Instead of

<Consumer>

{({text}) => {

  return <div> {text} </div>
}}

</Consumer>

You can do

const [data] = useConsumer()

return <div> {data.text} </div>

It gets messy with a real complex application.

typing on mobile is sad.

Re:A Critique of React Hooks Addendum by hombre_fatal on Thursday May 07, 2020 @08:09PM (#23109874)
Indenting by four spaces gives you preformatted text on HN. It's for code.