TypeScript: `Find References` doesn't find lazy loaded React components

Does this issue occur when all extensions are disabled?: Yes Does this issue occur in the Insiders build?: Yes VS Code Version: 1.71.2 OS Version: MacOS 12.5.1 (MacBook Pro 2019)

The problem is that Find References doesn’t find React components that are lazy loaded.

Steps to Reproduce:

  1. Export a React component. Screenshot 2022-09-23 at 09 51 58

  2. Lazy load it somewhere. Screenshot 2022-09-23 at 09 52 06

  3. Check that VS Code doesn’t find any reference for the component.

Not sure if it’s a bug or intended behavior (probably intended), but nonetheless it would be nice that finding references would also find lazy-loaded ones. This forces me to always use standard search (with all the downsides of it) to see if I’ve used the Component somewhere that references can’t find.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 25 (6 by maintainers)

Most upvoted comments

This problem has troubled me for a long time

It makes refactoring so much harder

why close this issue, the problem is not resolved!