Yes, if you only need to pass state change one or two levels or with very few children, pass setState as prop will be fine.
But, if you need to manage complex state, use Context API with useReduer hook in the container component will be easier to maintain and scale. Or use other state management lib like redux
I think this will be a perfect case to use
ContextAPI to share state between parent and children componentscontext API is not a good solution here it is an over kill because if we use the SearchInput in many components we need many shared global states.
Yes, if you only need to pass state change one or two levels or with very few children, pass setState as prop will be fine.
But, if you need to manage complex state, use Context API with useReduer hook in the container component will be easier to maintain and scale. Or use other state management lib like redux
i agree