I am receiving weird error regarding GatePage.
See original GitHub issueError
Could not find "store" in either the context or props of "Connect(GatedPage)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(GatedPage)".
Main index
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { BrowserRouter } from "react-router-dom";
import "./assets/css/main.scss";
import App from "./App";
import { configureStore } from "./store";
import { verifyCredentials } from "./lib";
import * as serviceWorker from "./utils/serviceWorker";
const store = configureStore();
verifyCredentials(store);
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</Provider>,
document.getElementById("root")
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister();
Routes
import React, { Component, Fragment } from "react";
import { Route } from "react-router-dom";
import { generateRequireSignInWrapper } from "redux-token-auth";
import { Home, Login, Protected, SignUp } from "../containers";
import {
ROOT_PATH,
SIGN_IN_PATH,
SIGN_UP_PATH,
PROTECTED_PATH
} from "../constants/routes";
const requireSignIn = generateRequireSignInWrapper({
redirectPathIfNotSignedIn: "/login"
});
export default class Routes extends Component {
render() {
return (
<Fragment>
<Route exact path={ROOT_PATH} component={Home} />
<Route path={PROTECTED_PATH} component={requireSignIn(Protected)} />
<Route path={SIGN_IN_PATH} component={Login} />
<Route path={SIGN_UP_PATH} component={SignUp} />
</Fragment>
);
}
}
Main App container
import React, { Component } from "react";
import { withHead } from "../lib";
import { Layout } from "../components";
import Routes from "../Routes";
class App extends Component {
render() {
return (
<Layout>
<Routes />
</Layout>
);
}
}
export default withHead(App);
Versions
"dependencies": {
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-redux": "^6.0.0",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.2",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"redux-token-auth": "^0.19.0",
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:8
Top Results From Across the Web
When a USPS Text is not a USPS Text
I just received a text from usps regarding a shipment ... I am receiving text messages indicating my scheduled delivery has been changed....
Read more >Got a package you didn't order? It could be a scam
Sending an item (even the wrong one) creates a tracking number, and when the package is delivered, it enables brushers to write a...
Read more >Did You Receive a Text Message From Yourself? You're Not ...
Text spam is on the rise. The latest version involves scammers sending messages to you seemingly from your own phone number. Here's what...
Read more >can't place stone foundation ark
While it too allows strange items as stone or sulfur for Rock Elementals, … ... Upon the top of the ark, probably not...
Read more >How to Spot and Report Internet and Email Scams
Scams are especially common on the Internet, where new technologies and anonymity ... But there are steps you can take to help stop...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you can also just replace the
requireSignIn
function by this one:@suyesh Follow https://yarnpkg.com/lang/en/docs/selective-version-resolutions/, Adding this config to your package.json to resolve the issue, I tested and it works
This config tells redux-token-auth depends on newest react-redux version