Add `displayName` for Context component
See original GitHub issueIs your feature request related to a problem? Please describe.
Add displayName
for Context component to improve DX
SomeContext.Consumer.displayName = "SomeContext.Consumer";
SomeContext.Provider.displayName = "SomeContext.Provider";
Describe the solution you’d like
Describe alternatives you’ve considered N/A
Additional context N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Context - React
Context object accepts a displayName string property. React DevTools uses this string to determine what to display for the context. For example, the...
Read more >React Reference Guide: Context API - LogRocket Blog
Context.displayName is a string property from the React.createContext method call. The React DevTools will use ...
Read more >reactjs - Is it possible to change the displayName of a Context ...
This works (at least on React v16.3.0+): SomeContext.Consumer.displayName = "SomeContext.Consumer"; SomeContext.Provider.
Read more >Context.displayName - react - Web Coding Center
Context object accepts a displayName string property. React DevTools uses this string to determine what to display for the context. RESETRUNFULL
Read more >Allow to specify displayName for createContext() providers ...
React can't "guess" the name from the declaring code but we should probably make it possible to specify displayName manually for React DevTools....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! I just found out about this awesome library and would very much like to help out! is this enhancement already planned? If not, I’d like to contribute with this if that’s okay 😊
Thanks!