I want to make a generic input component using hooks but not 100% sure how to implement this.
So I have a parent component
const Parent = () => {
const [team, setTeam] = useState('');
return <Input onChange={???} value={team} />
}
and then my Input component looks like this.
const Input = ({onChange}) => {
return <input onChange={onChange} />
}
I am wondering where the state should be stored. Is it in the Parent component, or in the Input or do both need to store state?