You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not possible to find-all-references for export default of anonymous type #19122
It is possible, somehow, to Find all references of the exported anonymous function declaration.
Actual behavior:
It is not possible to Find all references through any means other than temporarily giving the function declaration a name; or to import it from somewhere else and try to Find all references of the imported value.
This also affects anonymous classes and anonymous expression results.
In this case, the best case behavior would be that asking to Find all references of the default token in export default would find the references to the default export.
Note that searching for references to the x variable does not report things that import it, even though it is an aliased live-binding export. Only looking for references to default return users of the component.
In either case, it's not possible to find them with the export default connect(...)(...) expression. Searching for references to Component does happen to find things importing it, but the use is indirect and incidental (only its type is used, as part of the return type of connect()()).
This was tested with 2.5.3 as I have not been able to update to 2.6.0 yet.
My project is strict, isolatedModules, with allowSyntheticDefaultExports and module: esnext.
Activity
mhegazy commentedon Oct 12, 2017
defaultshould get you the references..Jessidhia commentedon Oct 17, 2017
I happened to reproduce it now in my project but not with an anonymous function, but an anonymous expression.
Not possible to find all references:
Possible to find all references by searching for references to
default:Note that searching for references to the
xvariable does not report things that import it, even though it is an aliased live-binding export. Only looking for references todefaultreturn users of the component.In either case, it's not possible to find them with the
export default connect(...)(...)expression. Searching for references toComponentdoes happen to find things importing it, but the use is indirect and incidental (only its type is used, as part of the return type ofconnect()()).This was tested with 2.5.3 as I have not been able to update to 2.6.0 yet.
My project is
strict,isolatedModules, withallowSyntheticDefaultExportsandmodule: esnext.mhegazy commentedon Oct 17, 2017
I see. thanks for the repro. here is a simpler repro: