1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-28 17:49:43 +02:00
planka/client/src/hooks/use-field.js

12 lines
292 B
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import { useCallback, useState } from 'react';
export default (initialValue) => {
const [value, setValue] = useState(initialValue);
const handleChange = useCallback(({ target: { value: nextValue } }) => {
setValue(nextValue);
}, []);
return [value, handleChange, setValue];
};