Files
planka/client/src/hooks/use-field.js
T
2025-05-10 02:09:06 +02:00

17 lines
435 B
JavaScript

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
import { useCallback, useState } from 'react';
export default (initialValue) => {
const [value, setValue] = useState(initialValue);
const handleChange = useCallback((_, { value: nextValue }) => {
setValue(nextValue);
}, []);
return [value, handleChange, setValue];
};