You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16.3
Just wanted to put an idea out here for feedback to see if this would be something useful. I've been using the new context API a bit and noticed myself repeating a pattern. A lot of my components look something like:
This is similar to connect from redux or withRouter from react-router in which the context value(s) are being injected by a HOC. I can write my own HOC to do this using the existing Consumer component from the Context API - but thought I'd put this out here for possible inclusion in the API itself.
Do you want to request a feature or report a bug?
feature
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16.3
Just wanted to put an idea out here for feedback to see if this would be something useful. I've been using the new context API a bit and noticed myself repeating a pattern. A lot of my components look something like:
This got me to wondering. What if the Consumer could be exposed as a HOC?
This is similar to
connect
from redux orwithRouter
from react-router in which the context value(s) are being injected by a HOC. I can write my own HOC to do this using the existing Consumer component from the Context API - but thought I'd put this out here for possible inclusion in the API itself.Thoughts?
The text was updated successfully, but these errors were encountered: