Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能找到嵌套上下文的方法并避免这个地狱?
这有效(至少在 React v16.3.0+ 上):
SomeContext.Consumer.displayName = "SomeContext.Consumer"; SomeContext.Provider.displayName = "SomeContext.Provider";