Open tfs-tada opened 1 month ago
type Props = { target: string }; type Action = Props | ((prevState: Props) => Props); type Dispatch = (action: Action) => void; const func: Dispatch = (prevState) => ({ target: "new" }); const newState = { hoge: "hoge" }; func({ target: "old", ...newState }); // エラーが出ない