I have different forms in different components. And one input, which I reuse in these components. If the user write smth in one component, another components should show this text too. And I don't know how to send this info to other components.
const InputComponent = () => {
const [isInput, setisInput] = useState("");
const changeInput = (event: ChangeEvent<HTMLInputElement>) => {
setIsInput(event.target.value);
};
return <input type="text" value="isInput" onChange={changeInput} />;
};
And after it I need to reflect the inputed text in the other components.
const AnotherComponent = () => {
return (
<>
<InputComponent />
<button>send</button>
</>
);
};