I get a typeScript error after upgrading to version 4 Used in useParams () from react-router-dom
"typescript": "^4.0.2"
Another option is:
const { sumParams } = useParams() as { sumParams: string; }