redux-first-history

Redux history binding support react-router - @reach/router - wouter - react-location

MIT License

Downloads
225.2K
Stars
445
Committers
12

Bot releases are visible (Hide)

redux-first-history - v5.2.0 Latest Release

Published by salvoravida 10 months ago

  • support redux 5.0 (peer dep and types)
redux-first-history - v5.1.1

Published by salvoravida about 2 years ago

redux-first-history - v5.1.0

Published by salvoravida about 2 years ago

  • Added support for basename
import { createReduxHistoryContext } from "redux-first-history";
import { createBrowserHistory } from 'history'; //v5

const { createReduxHistory, routerMiddleware, routerReducer } = createReduxHistoryContext({ 
  history: createBrowserHistory(),
  basename: '/app',
  //other options if needed 
});
redux-first-history - v5.0.12

Published by salvoravida over 2 years ago

fix: remove deprecated oldLocationChangePayload from interface

redux-first-history - v5.0.11

Published by salvoravida over 2 years ago

fix: type for Location in locationChangeAction and history 5.x

redux-first-history - v5.0.10

Published by salvoravida over 2 years ago

  • fix: remove reach/router dep if not needed
redux-first-history - v5.0.9

Published by salvoravida over 2 years ago

(#64): Add RouterActions type

redux-first-history - v5.0.8

Published by salvoravida almost 3 years ago

fix (#60): Support history 5.1 types on push/replace

redux-first-history - v5.0.7

Published by salvoravida almost 3 years ago

  • restored internal rr6 support (react-router v6.1.1)

rr6 support :

import { HistoryRouter as Router } from "redux-first-history/rr6";
import { Route, Routes, Navigate } from "react-router-dom";
//...
import { store, history } from "./store";
//...

     <Router history={history}>
                 <Routes>
                   <Route path="/dashboard" element={<Dashboard />} />
                   <Route path="/" element={<Home />} />
                   <Route path="*" element={<Navigate to="/" />} />
                 </Routes>
     </Router>

demo rr6 here: https://codesandbox.io/s/redux-first-history-demo-rr6-uccuw

redux-first-history - v5.0.6

Published by salvoravida almost 3 years ago

rr6 support :

import { Route, Routes, Navigate, HistoryRouter as Router } from "react-router-dom";
import { store, history } from "./store";
//...
     <Router history={history}>
                 <Routes>
                   <Route path="/dashboard" element={<Dashboard />} />
                   <Route path="/" element={<Home />} />
                   <Route path="*" element={<Navigate to="/" />} />
                 </Routes>
     </Router>

redux-first-history - v5.0.5

Published by salvoravida almost 3 years ago

fix jest import on rr6

redux-first-history - v5.0.4

Published by salvoravida almost 3 years ago

  • Strongly type action creators (#58) (Thanks to @devzeebo)
  • Adjust readme (#54) (Thanks to @sgnilreutr)
redux-first-history - v5.0.3

Published by salvoravida almost 3 years ago

  • fix RouterState type propagation
redux-first-history - v5.0.2

Published by salvoravida almost 3 years ago

v5.0.2

  • fix types for react-router v6.0.2
redux-first-history - v5.0.1

Published by salvoravida almost 3 years ago

  • fixed npm package src missing
redux-first-history - v5.0.0

Published by salvoravida almost 3 years ago

  • rewritten in TS
  • add support for react-router v6 !
  • tests coverage 100% !

rr6 support :

import { HistoryRouter as Router } from "redux-first-history/rr6";
import { Route, Routes, Navigate } from "react-router-dom";
//...
import { store, history } from "./store";
//...

     <Router history={history}>
                 <Routes>
                   <Route path="/dashboard" element={<Dashboard />} />
                   <Route path="/" element={<Home />} />
                   <Route path="*" element={<Navigate to="/" />} />
                 </Routes>
     </Router>

demo rr6 here: https://codesandbox.io/s/redux-first-history-demo-rr6-uccuw

BREAKING CHANGES:

  • removed option "oldLocationChangePayload"
redux-first-history - v5.0.0-beta.2

Published by salvoravida about 3 years ago

  • rewritten in TS
  • add support for react-router v6.0.0-beta.1
import { HistoryRouter as Router } from "redux-first-history/rr6";
import { Route, Routes, Navigate } from "react-router-dom";
//...
import { store, history } from "./store";
//...

     <Router history={history}>
                 <Routes>
                   <Route path="/dashboard" element={<Dashboard />} />
                   <Route path="/" element={<Home />} />
                   <Route path="*" element={<Navigate to="/" />} />
                 </Routes>
     </Router>

demo rr6 here: https://codesandbox.io/s/redux-first-history-demo-rr6-uccuw

redux-first-history - v5.0.0-beta.1

Published by salvoravida about 4 years ago

BREAKING CHANGES:

  • removed oldLocationChangePayload flag
import { createReduxHistoryContext, reachify } from "redux-first-history";
import { createWouterHook } from "redux-first-history/wouter";
import { createBrowserHistory } from "history";

const { createReduxHistory, routerMiddleware, routerReducer } = createReduxHistoryContext({ 
    history: createBrowserHistory(), 
 });

export const history = createReduxHistory(store);
export const reachHistory = reachify(history);
export const wouterUseLocation = createWouterHook(history);
redux-first-history - v4.6.0-beta.1

Published by salvoravida over 4 years ago

import { createReduxHistoryContext, reachify } from "redux-first-history";
import { createWouterHook } from "redux-first-history/wouter";
import { createBrowserHistory } from "history";

const { createReduxHistory, routerMiddleware, routerReducer } = createReduxHistoryContext({ 
    history: createBrowserHistory(), 
    listenObject: true, // support react-router v6.0
 });

export const history = createReduxHistory(store);
export const reachHistory = reachify(history);
export const wouterUseLocation = createWouterHook(history);
redux-first-history - v4.5.0

Published by salvoravida over 4 years ago

  • support imperatively navigate from @reach/router import { navigate } from '@reach/router'`

usage:

import { createBrowserHistory } from 'history';
import { globalHistory } from '@reach/router';

const { createReduxHistory, routerMiddleware, routerReducer } = createReduxHistoryContext({ 
  history: createBrowserHistory(),
  //others options if needed 
  reachGlobalHistory: globalHistory 
});