4

I enabled a webpack alias in my jsconfig.json file for VSCode.

But when I go to definition of a React component, I get 2 definitions:

  1. my react component
  2. an index.d.ts file of node_modules/@types/react

How do I get rid of the index.d.ts file ? Knowing that I use only jsx.

popo63301
  • 509
  • 1
  • 4
  • 10

1 Answers1

2

All of the components in the project are written using the React.FC type and are automatically exported.

One way to fix an issue with the "Goto Location: Multiple Definitions" feature in the Editor is to change the configuration from peek to goto.

enter image description here

This may hide some additional definitions that may be useful, but it will make the feature work as intended when clicking on components.

jurcola
  • 359
  • 4
  • 7
  • Good! This is more of a workaround to the actual problem. Not sure how will this work when you have 2 legit definitions – ACV Jul 01 '23 at 18:45