react-search-autocomplete
react-search-autocomplete copied to clipboard
Question: I would like to know how to differentiate several <ReactSearchAutocomplete /> in a single component
I have several inputs inside a form. 3 of them are react-search-autocomplete. So, I had the question how I could identify each combobox. If with an id or a name...
I don't want to have to create an OnHandleSearch for
const [state, setState] = useState({
product: "",
discount: 0,
price: 0,
tax: "",
description: "",
amount: 0,
total: 0,
});
I'm waiting for manage the autocomplete's components like this
const handleChange = (e) => {
setState({
...state,
[e.target.name]: e.target.value,
});
};
Thank u!
Black: <ReactSearchAutocomplete />
Blue: Simple input
Sorry, multiple search boxes in one page are not yet supported, there could be some issues.
Anyway this seems more likely an issue with how to manage your code rather than how to use the component itself. Also I'm not a 100% sure what the problem is 🤔