1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fix the bug with not passing props to wrapped element of with-rematch example (#5483)

This commit is contained in:
zsx 2018-10-20 20:31:26 +08:00 committed by Tim Neutkens
parent f5156b2297
commit 5b6489ebf3

View file

@ -27,7 +27,7 @@ export default (...args) => Component => {
const ConnectedComponent = connect.apply(null, connectArgs)(Component)
const ComponentWithRematch = (props = {}) => {
const { store, initialProps, initialState } = props
const { store, initialProps, initialState, ...others } = props
// Wrap with redux Provider with store
// Create connected page with initialProps
@ -39,7 +39,7 @@ export default (...args) => Component => {
? store
: getOrCreateStore(initStore, initialState)
},
React.createElement(ConnectedComponent, initialProps)
React.createElement(ConnectedComponent, { ...initialProps, ...others })
)
}