File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export type TConnect<Config extends Configuration> = {
1111}
1212
1313let nextComponentId = 0
14-
14+ /*
1515export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
1616 const componentId = nextComponentId++
1717 let componentInstanceId = 0
@@ -29,7 +29,7 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
2929 actions: overmind.actions,
3030 }
3131 this.__componentInstanceId = componentInstanceId++
32- this . __shouldUpdatePaths = false
32+ this.__tree = false
3333 this.__currentTrackId = null
3434 this.__listener = null
3535
@@ -129,3 +129,4 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
129129 return target
130130 }
131131}
132+ */
Original file line number Diff line number Diff line change @@ -134,8 +134,9 @@ export const createConnect = <A extends Overmind<Configuration>>(
134134 if ( isClassComponent ) {
135135 const originalRender = component . prototype . render
136136 component . prototype . render = function ( ) {
137- this . tree . track ( this . props . overmind . onUpdate )
138- return originalRender ( )
137+ this . props . overmind &&
138+ this . props . overmind . tree . track ( this . props . overmind . onUpdate )
139+ return originalRender . call ( this )
139140 }
140141 }
141142
@@ -180,6 +181,7 @@ export const createConnect = <A extends Overmind<Configuration>>(
180181 state : this . tree . state ,
181182 actions : overmind . actions ,
182183 onUpdate : this . onUpdate ,
184+ tree : this . tree ,
183185 } ,
184186 } as any )
185187 }
You can’t perform that action at this time.
0 commit comments