Hacker News new | past | comments | ask | show | jobs | submit login

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.




Indenting by four spaces gives you preformatted text on HN. It's for code.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: