useImperativeHandle | React Hooks Tutorial #12
Автор: Philip Fabianek
Загружено: 2021-04-14
Просмотров: 6142
Описание:
In this final episode of my React Hooks Tutorial, we will learn about the useImperativeHandle hook. In order to understand the useImperativeHandle hook, we first have to understand the concept of forwarding refs using the React.forwardRef function. This allows us to pass refs to nested components, because we cannot achieve so using the ref keyword. After that, we will make use of the useImperativeHandle hook inside an input to modify the forwarded ref by exposing a custom focusAndBlur property. The useImperativeHandle hook will allow us to call that method from the parent component using a button.
Starting repository:
https://github.com/philipfabianek/rea...
Ending repository:
https://github.com/philipfabianek/rea...
Timestamps:
►0:00 Introduction
►0:26 Explaining forwaring refs
►1:09 Explaining the useImperativeHandle hook
►1:44 Creating input and the parent ref
►2:23 Forwarding the parent ref
►3:38 Implementing the useImperativeHandle hook
►5:10 Creating a button to call focusAndBlur on click
►5:45 Ending
Social Media:
►Twitter: / philip_fabianek
►LinkedIn: / philip-fabianek
►Website: http://www.philipfabianek.com
►GitHub: https://github.com/philipfabianek
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: