Category : connected-react-router

When I run the react project by npm start in the project then the auto path is created project folder name. For example http://localhost:3002/bug-palace But after the run, it was supposed to do http://localhost:3002 shows. When I clicked Home than show me the right home path http://localhost:3002 please solve the problem, anyone. npm start (picture) ..

Read more

I’ve updated react versions. And jumping from react-router-redux to connected-react-router. Providing package.json file below. mostly it’s happening after upgraded react latets version. So getting following error. index.js:31 Uncaught TypeError: Cannot read property ‘string’ of undefined at Object.<anonymous> (index.js:31) at __webpack_require__ (bootstrap 57766baaa3c8c796877e:555) at fn (bootstrap 57766baaa3c8c796877e:86) at Object.<anonymous> (Deposit.jsx:15) at __webpack_require__ (bootstrap 57766baaa3c8c796877e:555) at fn ..

Read more

In my react app, I am using the connected-react-router library which is helpful to manage routing inside the redux part. Today, I have faced a case that needs to capture location change event inside reducer. I was thinking it would be possible by catching the LOCATION_CHANGE action and actually I can catch location change event ..

Read more

I know it’s basic, but it really doesn’t work and I am very curious why. I am using react union to render 2 react apps const Root = () => ( <Provider store={store}> <Union routes={[ { path: "tickets", component: universal(import("@core/tickets"), { loading: Loader }) }, { path: "manage-users", component: universal(import("@core/manage-users"), { loading: Loader }) } ..

Read more

This is my store.ts import { createStore, compose, applyMiddleware } from ‘redux’; import createSagaMiddleware from ‘redux-saga’; import rootSaga from ‘sagas’; import rootReducer from ‘reducers’; import { history } from ‘common/helpers/historyHelper’; import { routerMiddleware } from ‘connected-react-router’; declare global { interface Window { // eslint-disable-line __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: typeof compose; // eslint-disable-line } } const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ..

Read more

I have have this Saga for retrieving the token from localStorage and sign in the user automatically export function* authCheckState(action) { const token = localStorage.getItem("jwt"); const expDate = localStorage.getItem("expDate"); if (!token) { yield put(actions.logout()); } else { const expirationDate = new Date(expDate); if (expirationDate <= new Date()) { yield put(actions.logout()); } else { axios.defaults.headers.common[‘Authorization’] = ..

Read more

not sure this is related specifically to react-router, but when a third party puts my site IN their iframe, the following error happens. When viewing my site outside an iframe, all fine. SecurityError: Failed to execute ‘replaceState’ on ‘History’: A history state object with URL ‘https://books.mysite.com’ cannot be created in a document with origin ‘https://someThirdPartyWebsite.com’ ..

Read more