function App() {
const [initial, setInitial] = useState('#5e72e4');
const [color, setColor] = useState({});
return (
<div>
<div
style={{
width: 50,
height: 50,
marginBottom: 20,
backgroundColor: color.rgba
}}
>
{color.rgba}
</div>
<input
type="color"
value={color.hex}
onChange={e => setInitial(e.target.value)}
/>
<br />
<InputColor initialValue={initial} onChange={setColor} />
</div>
);
}