How can i pass a filtered data into another sibling component in React?

165 Views Asked by At

I have multiple places where I need to filtered out different data, I decided to create a search component that can receive dynamic values through props. The new array coming from the search component should be pass to a new component.

I create a dummy example like this one :

<SearchBar placeholder='Search project by company name' filterFunc={'pass the function that get the input value'}/>

<TableData data={'new array coming from search component'}/>

I try to use the useState hook to store the filtered data but I did not succeed. Can you please help me with a possible solution ?

0

There are 0 best solutions below