Skip to content

Commit 1b8bfc7

Browse files
zsxsofttimneutkens
authored andcommitted
Fix the bug with creating duplicate components of with-rematch example (#5440)
1 parent 95a6a87 commit 1b8bfc7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/with-rematch/shared/utils/withRematch.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ const getOrCreateStore = (initStore, initialState) => {
2323
export default (...args) => Component => {
2424
// First argument is initStore, the rest are redux connect arguments and get passed
2525
const [initStore, ...connectArgs] = args
26+
// Connect page to redux with connect arguments
27+
const ConnectedComponent = connect.apply(null, connectArgs)(Component)
2628

2729
const ComponentWithRematch = (props = {}) => {
2830
const { store, initialProps, initialState } = props
2931

30-
// Connect page to redux with connect arguments
31-
const ConnectedComponent = connect.apply(null, connectArgs)(Component)
32-
3332
// Wrap with redux Provider with store
3433
// Create connected page with initialProps
3534
return React.createElement(

0 commit comments

Comments
 (0)