Skip to content

Instantly share code, notes, and snippets.

View moshemal's full-sized avatar

Moshe Malka moshemal

  • Tel Aviv, Israel
View GitHub Profile
@moshemal
moshemal / App.jsx
Last active November 9, 2023 00:26
Debug react-router routings
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Login from 'components/Login'
import DefaultComponent from 'components/DefaultComponent'
class DebugRouter extends Router {
constructor(props){
super(props);
console.log('initial history is: ', JSON.stringify(this.history, null,2))
this.history.listen((location, action)=>{