react-spreadsheet
react-spreadsheet copied to clipboard
type error on onChange prop, and nextjs router malfunctioning
I have a nextjs page with a Spreadsheet component on it. If I add the onChange prop, I get a type error:
Type 'Dispatch<SetStateAction<{ value: ""; }[][] | undefined>>' is not assignable to type '(data: Matrix<{ value: ""; }>) => void'.
Types of parameters 'value' and 'data' are incompatible.
Type 'Matrix<{ value: ""; }>' is not assignable to type 'SetStateAction<{ value: ""; }[][] | undefined>'.
Type '({ value: ""; } | undefined)[][]' is not assignable to type '{ value: ""; }[][]'.
As soon as I edit the spreadsheet, that component gets rendered on all pages. Idk, it totally breaks the router whenever I actually try to change state with it. Any ideas?
Here's a stack overflow post with a lot more detail:
https://stackoverflow.com/questions/71975915/router-changes-url-without-changing-the-component
Hey dmm22, thank you for giving React Spreadsheet a spin! Can you provide a CodeSandbox that reproduces the issue?