Chalarangelo / furl

Functional react.js components.

Home Page:https://furl.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add state to Search component

Chalarangelo opened this issue · comments

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.