They enable you to utilize state as well as other respond features without composing a course.
This brand new function useState is the very first “Hook” we’ll read about, but this instance is simply a teaser. Don’t worry if it does not yet make sense!
You could begin learning Hooks in the next web page. With this web web page, we’ll continue by explaining why we’re adding Hooks to respond and exactly how they could allow you to compose great applications.
Respond 16.8.0 could be the release that is first help Hooks. Whenever upgrading, don’t forget to upgrade all packages, including respond DOM. Respond Native supports Hooks considering that the 0.59 release of Respond Native.
At React Conf 2018, Sophie Alpert and Dan Abramov introduced Hooks, accompanied by Ryan Florence demonstrating how exactly to refactor a credit card applicatoin to make use of them. View the video clip right right here:
No Breaking Modifications
Before we continue, remember that Hooks are:
- Totally opt-in. You can look at Hooks in some elements without rewriting any code that is existing. However you don’t need to learn or utilize Hooks at this time in the event that you don’t would you like to.
- 100% backwards-compatible. Hooks don’t contain any breaking modifications.
- Now available. Read more Launching Hooks. Hooks are a definite recent addition in respond 16.8.