type Color = {
name: string;
value: string;
};
export type BoardData = {
boardName: string;
description: string;
color: Color;
};
const [boardData, setBoardData] = useState<BoardData>({
boardName: '',
description: '',
color: { name: '', value: '' },
});
type Props = {
color: Color;
boardData: BoardData;
setBoardData: () => void; // как типизировать эту функцию (тип BoardData)
};
setBoardData({
...boardData, // (parameter) boardData: BoardData Expected 0 arguments, but got 1.ts(2554)
color: { name: color.name, value: color.value },
});
type Props = {
color: Color;
boardData: BoardData;
setBoardData: (data: BoardData) => void; // как типизировать эту функцию (тип BoardData)
};
setBoardData({
...boardData, // (parameter) boardData: BoardData Expected 0 arguments, but got 1.ts(2554)
color: { name: color.name, value: color.value },
});