Skip to content

Commit a588128

Browse files
committed
fix(middleware): do not get options props when options does not exist
1 parent ce40110 commit a588128

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/middleware/router.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ const router = ( routes, { isServer = false } = {}) => ({ dispatch }) => {
88
}
99

1010
return next => initialAction => {
11-
const { options: { shouldAddToHistory }, to, type } = initialAction;
11+
const { type } = initialAction;
1212

1313
if ( type === CHANGE_PAGE_TO ) {
14+
const { options: { shouldAddToHistory }, to } = initialAction;
15+
1416
const action = getAction( to, routes );
1517

1618
if ( !isServer && shouldAddToHistory ) {

0 commit comments

Comments
 (0)