2

How can I find my way around nested Contexts and avoid this hell?

enter image description here

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Qwerty
  • 29,062
  • 22
  • 108
  • 136
  • how did that even happen? – Omar May 02 '18 at 17:39
  • 1
    Well as of now there isn't a way in react-devtools to separate out the Context displayname, there is an open issue on the same https://github.com/facebook/react-devtools/issues/1008 – Shubham Khatri May 02 '18 at 17:46

1 Answers1

1

This works (at least on React v16.3.0+):

SomeContext.Consumer.displayName = "SomeContext.Consumer";
SomeContext.Provider.displayName = "SomeContext.Provider";
Niki
  • 1,105
  • 1
  • 10
  • 17