Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support setting Context displayName in `@babel/plugin-transform-react-display-name` #11241
Is your feature request related to a problem? Please describe.
Here's an example of React DevTools with a few context providers and consumers:
You'll notice that the context consumer and provider rendered under
They accomplish this by setting the context's
Here are some test cases:
import React from 'react' const MyContext = React.createContext() MyContext.displayName = 'MyContext'
Describe the solution you'd like
Describe alternatives you've considered
I can set it manually. Not desirable. Or I could write my own babel plugin, but then others wouldn't benefit from it if they either don't know about the plugin or can't install it. Also, this seems to make a lot of sense to be included here to me.
Teachability, Documentation, Adoption, Migration Strategy
No need, it'll just magically start working and people will be pleasantly surprised.
I would love to help :) !
However, I think