select
select copied to clipboard
Select Component Without Type hint in vscode using lowerer version(less than 3.8) of typescript
in line 16 of source code: https://github.com/react-component/select/blob/master/src/generate.tsx
it uses the grammar import type
which can only be used in typescript version gte v3.8
It will become weird that And design Select Component can non HINT TYPE when your vscode uses typescript version lt 3.8
I hope you can write docs(Q&A) in And Design to emphasis it. causing the action is realllllly weird!
how to fix it?
- install typescript globally with version gt 3.8
- press
F1
in your vscode - search
workspace settings
- search
typescript.tsdk
- click
edit in settings.json
- add your config in json file, for instance below:
{
"typescript.tsdk": "{your_global_npm_path}/typescript/lib"
}
in your teminal, input npm root -g
to get your your_global_npm_path
and replace it in above config