Open
Description
Repro steps
We're using HOCs as a way to tag components with certain concerns, this gives us the ability to trim the React Devtools tree to trim down on components that are irrelevant or out of scope (or even specifically in scope).
This works well, except that the name parsing does not apply for named contexts:
const MyOverlayContext = createContext<ContextData | undefined>(undefined);
MyOverlayContext.displayName = 'overlay(MyOverlayContext)'
// shows up as overlay(MyOverlayContext).Provider, instead of MyOverlayContext.Provider [overlay]
() => <MyOverlayContext.Provider />
(We're aware that this isn't how ExoticNamedComponent
or HOCs are meant to be used, but they give us the ability to quickly search the tree for certain tags, quickly filter out many browser- or display-like nodes, like <Button />
, ` and so on. If you're taking PRs, I would have a look at that, too.)
How often does this bug happen?
Every time