Closed eugef closed 5 years ago
It's a duplicate of #77.
As for the new context API, it can't be removed.
@oliviertassinari I double checked React 16 documentation about Context API and contextTypes
are not mentioned there at all. I am also using Context API without defining any contextTypes
and it works as expected.
The only static field that is required for Context API is contextType
https://reactjs.org/docs/context.html#classcontexttype
Please reconsider either re-opening this issue or PR #77
@eugef I don't understand.
With new Context API it is safe to remove static contextTypes
because this filed is not required anymore
contextTypes
is a legacy API, you are not supposed to use it in the first place.
Would be nice to remove
static contextTypes
from the components as well.According to React documentation this static field is not required, only
static contextType
(singular form here!) is needed https://reactjs.org/docs/context.html#classcontexttype