What do you want to save?
Add Code snippet
New code examples
-
-
Javascript 2021-11-14 22:47:13
react route send informaion in url
// your route setup <Route path="/category/:catId" component={Category} / > // your link creation const newTo = { pathname: "/category/595212758daa6810cbba4104", param1: "Par1" }; // link to the "location&q... Add solution -
Javascript 2021-11-14 21:56:29
debug react routes
import React, { Component } from 'react'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import Login from 'components/Login' import DefaultComponent from 'components/DefaultComponent' class DebugRouter extends BrowserRouter { constru... Add solution -
Javascript 2021-11-12 10:07:35
detect browser back button click react
import { useHistory } from 'react-router-dom' const [ locationKeys, setLocationKeys ] = useState([]) const history = useHistory() useEffect(() => { return history.listen(location => { if (history.action === 'PUSH') { setLocationKeys([... Add solution -
Javascript 2021-11-11 04:37:17
react-router in saga
/** history.js ****/ import {createBrowserHistory} from 'history' export default createBrowserHistory({your_config_here}) /** saga.js ***/ import {... call} from 'redux-saga/effects' import history from './history' export default function* your_root_sag... Add solution