I am using create-react-app and its typescript template, but when trying to retrieve the type of the property 'pending' in 'GenericAsyncThunk' like in redux-toolkit docs like this:
type PendingAction = ReturnType<GenericAsyncThunk["pending"]>;
I get an error: Parsing error: Unexpected token, expected "]"
Edit: looks like the errors only shows up on my machine and works in CodeSandbox. The error appears when the project is ran with the command npm start
. Here is the full output:
Any suggestions on how to tackle this?