Skip to content

Setting displayName on Context.Consumer has no effect #7204

@apostolos

Description

@apostolos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions