December 2019
Intermediate to advanced
598 pages
12h 21m
English
In this section, we are going to handle the change event on the input element and interact with the event parameter in the event listener. Follow these steps to do so:
<input type="text" placeholder="Search..." onChange={handleSearchInputChange} css={ ... }/>
export const Header = () => { const handleSearchInputChange = (e: ChangeEvent<HTMLInputElement>) => { console.log(e.currentTarget.value); }; return ( ... );};
Notice the type of annotation for the event parameter. This ensures ...
Read now
Unlock full access