select icon indicating copy to clipboard operation
select copied to clipboard

Select Component Without Type hint in vscode using lowerer version(less than 3.8) of typescript

Open wfk007 opened this issue 3 years ago • 1 comments

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!

wfk007 avatar Apr 20 '21 06:04 wfk007

how to fix it?

  1. install typescript globally with version gt 3.8
  2. press F1 in your vscode
  3. search workspace settings
  4. search typescript.tsdk
  5. click edit in settings.json
  6. 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

wfk007 avatar Apr 20 '21 06:04 wfk007