1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

Fix handler in form/field hooks

This commit is contained in:
Maksim Eltyshev 2019-10-31 23:07:41 +05:00
parent 617dd32f4f
commit bc87c1d883
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ import { useCallback, useState } from 'react';
export default (initialValue) => {
const [value, setValue] = useState(initialValue);
const handleChange = useCallback(({ target: { value: nextValue } }) => {
const handleChange = useCallback((_, { value: nextValue }) => {
setValue(nextValue);
}, []);

View file

@ -3,7 +3,7 @@ import { useCallback, useState } from 'react';
export default (initialData) => {
const [data, setData] = useState(initialData);
const handleFieldChange = useCallback(({ target: { name: fieldName } }, { value }) => {
const handleFieldChange = useCallback((_, { name: fieldName, value }) => {
setData((prevData) => ({
...prevData,
[fieldName]: value,