Releases: supasate/connected-react-router
Releases · supasate/connected-react-router
v6.0.0-beta.1
Breaking Change
- Required upgrading to react-redux v6.
- Support react-redux v6 by using the new Context API.
- Support a custom context for
<Provider>
by providing it as acontext
props for both<Provider>
and<ConnectedRouter>
.
v5.0.1
v5.0.0
Breaking Change
Align public API with react-router-redux and allow various integrations (redux-loop, rematch, etc.) (@sgal in #150)
- In your reducer file, instead of exporting a root reducer, we need to export a function accepting
history
and returning a root reducer with arouter
key that uses connectRouter(history). Note: The key MUST berouter
.
// reducers.js
import { combineReducers } from 'redux'
import { connectRouter } from 'connected-react-router'
export default (history) => combineReducers({
router: connectRouter(history),
... // rest of your reducers
})
- 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 #150)
- Add TypeScript definitions for immutable (@thomschke in #145)
- Add TypeScript definitions for seamless-immutable (@Brettm12345 in #157)
- Use string literal type for CALL_HISTORY_METHOD (@maxhawkins in #147)
- Move redux-seamless-immutable to devDependencies (@n3tr in #167)
Bug fix
- Fix redux state is created on every action (@sgal in #150)
- Fix TypeScript error on React 16 (@thomschke in #145)
- Fix connectRouter TypeScript definition (@supasate in #156)
- Update RouterAction types to be strongly typed on the exact strings (@colbydehart in #149)
- Fix FAQ links (@durasj in #162 and #163)
v4.5.0
Feature
- Support seamless-immutable (@joeyfigaro in #127 and @Brettm12345 in #138)
Fix
- Fix TypeScript example config (@deemoding in #131)
- Add missing getLocaltion, getAction, and createMatchSelector for immutable structures (@lpillonel in #137)
v4.4.1
v4.4.0
Feature
- Dispatch location change action for initial location (@brian-lives-outdoors #96)
- Add selectors (getLocation, getAction, createMatchSelector) (@josepot in #98)
- [TypeScript] Add RouterAction (@brian-lives-outdoors in #95).
- [TypeScript] Expose an enum for RouterState.action (@tleverett in #106).
Enhancement
- [TypeScript] Use Location type from
history
(@VincentLanglet in #87). - Move react-router to peerDependency (@gustavovnicius in #93).
- Add FAQ on server-side rendering (@cereallarceny in #105).
Fix
- Update Redux peer dependency to Redux v4 (@brneto in #75).
- Update dependency in a TypeScript example (@tsekityam in #90).
- Fix 404 links in Readme (@abenhamdine and @luish in #82, #87, and #94).
- Fix typos in FAQ (@Armour and @meesvandongen in #100 and #101).
- Improve grammar in README and FAQ (@jbasilio in #112)