Tags: winklerp/connected-react-router
Tags
v5.0.1 Fixes ===== - Fix TypeScript type for connectRouter (@dimitriirybakov in supasate#169 and @supasate) - Move history library to peer dependencies (@supasate)
v5.0.0 Breaking Change =============== Align public API with react-router-redux and allow various integrations (redux-loop, rematch, etc.) (@sgal in supasate#150) 1. In your reducer file, instead of exporting a root reducer, we need to export a function accepting `history` and returning a root reducer with a router key that uses connectRouter(history). ``` // reducers.js import { combineReducers } from 'redux' import { connectRouter } from 'connected-react-router' export default (history) => combineReducers({ router: connectRouter(history), ... // rest of your reducers }) ``` 2. In store configuration, `` // configureStore.js import { createBrowserHistory } from 'history' import { applyMiddleware, compose, createStore } from 'redux' import { routerMiddleware } from 'connected-react-router' import createRootReducer from './reducers' const history = createBrowserHistory() const store = createStore( createRootReducer(history), // root reducer with router state initialState, compose( applyMiddleware( routerMiddleware(history), // for dispatching history actions // ... other middlewares ... ), ), ) `` Enhancement =========== - Expose router reducer with customized name to make it work with other libraries (redux-loop, rematch, etc) (@sgal in supasate#150) - Add TypeScript definitions for immutable (@thomschke in supasate#145) - Add TypeScript definitions for seamless-immutable (@Brettm12345 in supasate#157) - Use string literal type for CALL_HISTORY_METHOD (@maxhawkins in supasate#147) - Move redux-seamless-immutable to devDependencies (@n3tr in supasate#167) Bug fix ======= - Fix redux state is created on every action (@sgal in supasate#150) - Fix TypeScript error on React 16 (@thomschke in supasate#145) - Fix connectRouter TypeScript definition (@supasate in supasate#156) - Update RouterAction types to be strongly typed on the exact strings (@colbydehart in supasate#149) - Fix FAQ links (@durasj in supasate#162 and supasate#163)
v4.5.0 Feature ====== - Support seamless-immutable (@joeyfigaro in supasate#127 and @Brettm12345 in supasate#138) Fix === - Fix TypeScript example config (@deemoding in supasate#131) - Add missing getLocaltion, getAction, and createMatchSelector for immutable structures in supasate#137)
v4.4.1 - Use string literal type for action type (@OliverJAsh in supasate#64) - Fix: Rename RouterAction(enum) to prevent exported name collisin (@Armour in supasate#117)
v4.4.0 Feature --- - Dispatch location change action for initial location (@brian-lives-outdoors @96) - Add selectors (getLocation, getAction, createMatchSelector) (@josepot in supasate#98) - [TypeScript] Add RouterAction (@brian-lives-outdoors in supasate#95). - [TypeScript] Expose an enum for RouterState.action (@tleverett in supasate#106). Enhancement --- - [TypeScript] Use Location type from `history` (@VincentLanglet in supasate#87). - Move react-router to peerDependency (@gustavovnicius in supasate#93). - Add FAQ on server-side rendering (@cereallarceny in supasate#105). Fix --- - Update Redux peer dependency to Redux v4 (@brneto in supasate#75). - Update dependency in a TypeScript example (@tsekityam in supasate#90). - Fix 404 links in Readme (@abenhamdine and @luish in supasate#82, supasate#87, and supasate#94). - Fix typos in FAQ (@Armour and @meesvandongen in supasate#100 and supasate#101). - Improve grammar in README and FAQ (@jbasilio in supasate#112)
PreviousNext