bvaughn/react-devtools-experimental

Hook label is sometimes empty

gaearon opened this issue · 2 comments

Screen Shot 2019-06-18 at 5 40 21 PM

Seeing this in FB5TopNavBar.

It looks like the source code in this example has a "custom hook" that's assigned to a variable (e.g. useFoo) but is being created by a helper function (which returns an anonymous function, so there's no actual name being associated with the hook). So that's the first problem.

A second related problem is that FB's lazy/inline requires are resulting in this function being named e.g. "__annotator.module" in DEV (and empty string in prod).

Looks like we've created a new thing, the "Higher order Hook" 😭

Screen Shot 2019-06-18 at 11 36 46 AM

DevTools will, for now, just display these as dimmed "Anonymous"

Fixed in abc8ef3, deploying now.