Skip to content

Releases: supasate/connected-react-router

v6.0.0-beta.1

25 Nov 17:33
Compare
Choose a tag to compare
v6.0.0-beta.1 Pre-release
Pre-release

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 a context props for both <Provider> and <ConnectedRouter>.

v5.0.1

05 Nov 16:24
Compare
Choose a tag to compare

Fixes

v5.0.0

03 Nov 05:08
Compare
Choose a tag to compare

Breaking Change

Align public API with react-router-redux and allow various integrations (redux-loop, rematch, etc.) (@sgal in #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). Note: The key MUST be router.
// reducers.js

import { combineReducers } from 'redux'
import { connectRouter } from 'connected-react-router'

export default (history) => combineReducers({
  router: connectRouter(history),
  ... // rest of your reducers
})
  1. 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

23 Sep 16:50
Compare
Choose a tag to compare

Feature

Fix

  • Fix TypeScript example config (@deemoding in #131)
  • Add missing getLocaltion, getAction, and createMatchSelector for immutable structures (@lpillonel in #137)

v4.4.1

13 Aug 02:41
Compare
Choose a tag to compare

Fix

  • Rename RouterAction(enum) to prevent exported name collision (@Armour in #117).

Enhancement

v4.4.0

12 Aug 03:18
Compare
Choose a tag to compare

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

Fix

v4.3.0

19 Nov 15:06
Compare
Choose a tag to compare

Fix

  • Fix peer dependency after upgrading to React 16 (@petetnt in #62 and #63 )

v4.2.3

25 Jun 12:32
Compare
Choose a tag to compare

Fix

  • Fix build for npm registry to include new enhancement in v4.2.2

v4.2.2

25 Jun 12:20
Compare
Choose a tag to compare

Enhancement

  • Remove lodash.toPath to reduce file size (@odensc in #56)

v4.2.1

07 May 04:47
Compare
Choose a tag to compare

Fix

  • Add a missing TypeScript file