Answer the question
In order to leave comments, you need to log in
How to fire an event after the mouse button is released in React?
It is necessary that the event fires after the mouse button is first pressed and then released. That is, the mouseup event should fire. But how do you make this event fit the React philosophy?
UPD:
App.js:
const App = ({ color }) => {
const colorRef = useRef(color)
const record = (base) => {
// обновляется state
}
return (
<input type="color" ref={colorRef} defaultValue={color} onMouseUp={record} />
)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question