Chalarangelo / furl

Functional react.js components.
https://furl.netlify.com/
MIT License
34 stars 2 forks source link

Add state to Search component #48

Open Chalarangelo opened 5 years ago

Chalarangelo commented 5 years ago

Search renders children.

However, this can cause a few problems, as the developer has to handle state changes by rendering or hiding the Search contents, probably via the onChange event.

It should be refactored to have an internal state, so that Search handles focusing/unfocusing by showing/hiding its results.

On a side note, it might be a good idea to add a clear button or something similar to the component, so that it is more of a unique component and not just another Input.