November 2019
Beginner
804 pages
20h 1m
English
Our component is now almost complete. The last thing that we need to do is to let the outside world know whenever a search action is requested and whenever the search text gets cleared.
To do this, we will add two entries to our props, so that users of this component can pass in functions for us to call when the respective events occur.
Go ahead and modify the Props interface as follows:
type Props = {
searchTriggered: (searchText: string) => void;
searchCleared: VoidFunction;
};
We have defined two functions that we expect to receive through props:
Read now
Unlock full access