The error is Parsing error: Cannot read property 'map' of undefined
I set up a new file just to reproduce the error:
export default () => {
let something: [string, boolean]
something = ['something', true];
}
am i missing something? all other types seem to work fine.
The Problem
The problem is when you created the tuple type [string, boolean]
this is a new way to declare types with arrays introduced in Typescript 4.0 called Labeled Tuple Types.
The Solution
Upgrade your react-scripts to v4 (Here is the issue on their github). If you are using yarn
use the command yarn upgrade [email protected]
. With npm should be something similar, you can try npm install [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With