Closed
Description
DevTools hooks name parsing code currently assumes a single "source" for the source map:
react/packages/react-devtools-extensions/src/parseHookNames.js
Lines 428 to 434 in ed6c091
But as pointed out by comment #21641 (comment):
If the compiled code is a bundle, it can consist of multiple modules - what guarantees that
sources[0]
is the correct module for the hook we'll be looking up? TheoriginalPositionFor
call infindHookNames
above returns asource
property which we currently ignore; I think the correct thing to do is to lazily parse/cache the source at that point rather than make this assumption here.