Running directly on codesandbox.io here: https://codesandbox.io/s/nw0921qx3j
I can also re-create by using create-react-app on MacOS
When I copy-and-paste the instructions directly from the README into a fresh React app, the React component should render correctly.
Getting the following error:
Could not find "store" in either the context or props of "Connect(PlaygroundWrapper)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(PlaygroundWrapper)".
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Source+Code+Pro:400,700"
rel="stylesheet"
/>
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { Playground, store } from "graphql-playground-react";
ReactDOM.render(
<Provider store={store}>
<Playground endpoint="https://api.graph.cool/simple/v1/swapi" />
</Provider>,
document.body
);
_Please provide a gif or image of the issue for a quicker response/fix._
This bug is caused by the recent release of [email protected] and [email protected] which are used by create-react-app.
You can solve this problem by installing versions of those libraries that match with graphql-playground-react in your react app, which are followings:
"react-redux": "^5.0.6",
"redux": "^3.7.2"
That worked, thanks. For reference for anyone viewing this, here's a code sandbox with the fix:
Updates on this?
Most helpful comment
This bug is caused by the recent release of
[email protected]and[email protected]which are used bycreate-react-app.You can solve this problem by installing versions of those libraries that match with
graphql-playground-reactin your react app, which are followings: