Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting displayName on Context.Consumer has no effect #7204

Closed
apostolos opened this issue Mar 20, 2020 · 1 comment · Fixed by #8061
Closed

Setting displayName on Context.Consumer has no effect #7204

apostolos opened this issue Mar 20, 2020 · 1 comment · Fixed by #8061

Comments

@apostolos
Copy link
Contributor

react-router sets displayName on context consumers and producers. This has no effect. displayName should be set on the context object itself.

As of 15 days ago there is a new warning in React about this:
https://github.com/facebook/react/blame/d35f8a58184d1495ff54f4ad80c702e9468c89ee/packages/react/src/ReactContext.js#L131

Version

6.0.0-alpha.2
(with latest React build)

Test Case

https://codesandbox.io/s/react-router-context-displayname-fujnt

Steps to reproduce

Open console to see warning

Expected Behavior

There should be no warnings when using react router

@timdorr
Copy link
Member

timdorr commented Mar 21, 2020

Fixed in your PR. Thanks for that!

@timdorr timdorr closed this as completed Mar 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants