Closed malixsys closed 6 years ago
Thanks for the suggestion!
I'm not sure that is the best way forward though...
^16.3.1
to take advantage of the context API, lifecycle hooks, etc.GraphQLQuery
component in the public API that accepts a GraphQL
instance as a prop, they might use it not realizing that an app should only have one GraphQL
instance to hold the cache, and that it should be accessed in components via context.Once React Suspense is available we'll take advantage of it too, and the react
peer dep will be raised accordingly.
A better solution might be to update React for your webapp, which in many cases is fairly straightforward. Is that something that is doable?
It's not a good idea to support different versions of React for each part of the API. GraphQLQuery
happens work for you in right now in React v15 by dumb luck, other parts of the API will definitely not work.
To officially support React v15 would mean shifting the peer dep down (or you'll get peer dep warnings on npm install), polyfilling the context API (bundle size hit for all consumers), adding tests for React v15, etc. and I will have to avoid using modern component lifecycle hooks, which will lead to a worse product in the long run.
Data fetching is a critical part of a webapp. Most people begin using graphql-react
at the start of their project, and most people start new projects with a current version of React.
Regarding the question if it's possible to update React in your existing project,
Ok sorry, but that doesn’t work IRL.
I was hoping for something a little more specific to inform the discussion 😐
You'll find it increasingly difficult over time to fork every library built for modern React; it won't always be as easy as adding 7 "missing" characters.
Please export
GraphQLQuery
so the library can be used with React 15 andreact-broadcast
?https://github.com/jaydenseric/graphql-react/blob/fafa8b6f4c02d9c77a70e6da421ec6ff53f2313f/src/components.mjs#L78