Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Optional Provider #17

Closed
quisido opened this issue Nov 12, 2018 · 1 comment
Closed

Optional Provider #17

quisido opened this issue Nov 12, 2018 · 1 comment
Assignees
Labels
feature A new feature is requested.
Milestone

Comments

@quisido
Copy link
Collaborator

quisido commented Nov 12, 2018

Should help with concurrent SSR requests.

Context needs to be backwards compatible. Add the constructor(..., context) alternative?
Make sure createContext doesn't crash if older version of React.

Maybe only provide a Provider property if the React version supports useable context in the first place.

Provide the relevant global state to the methods -- the one from the context, not the built-in instance if a context is provided.

Safe fallback if no context is provided.

Relevant docs:
https://reactjs.org/docs/legacy-context.html -
https://reactjs.org/docs/context.html#classcontexttype - 16.3+
useContext - 16.7+

@quisido quisido self-assigned this Nov 12, 2018
@quisido quisido added the feature A new feature is requested. label Nov 12, 2018
@quisido
Copy link
Collaborator Author

quisido commented Jan 29, 2019

The store provided will need to be used by getGlobal(Provider) or getGlobal(store), depending on if this should use const Provider = createProvider(); or <Provider store={createStore()}>.

@quisido quisido added this to the 1.0.0 milestone Feb 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature A new feature is requested.
Projects
None yet
Development

No branches or pull requests

1 participant