File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
packages/node_modules/overmind-react/src Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
3+ exports [` React should allow using component as normal, even when not connected 1` ] = `
4+ <h1 >
5+ bar
6+ </h1 >
7+ ` ;
8+
9+ exports [` React should allow using component as normal, even when not connected 2` ] = `
10+ <h1 >
11+ nada
12+ </h1 >
13+ ` ;
14+
315exports [` React should allow using component as normal, event when connected 1` ] = `
416<h1 >
517 bar
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ describe('React', () => {
8989 expect ( tree ) . toMatchSnapshot ( )
9090 } )
9191
92- test ( 'should allow using component as normal, event when connected' , ( ) => {
92+ test ( 'should allow using component as normal, even when not connected' , ( ) => {
9393 expect . assertions ( 2 )
9494 const config = {
9595 state : {
Original file line number Diff line number Diff line change @@ -162,10 +162,14 @@ export const createConnect = <A extends Overmind<Configuration>>(
162162 if ( isClassComponent ) {
163163 const originalRender = component . prototype . render
164164 component . prototype . render = function ( ) {
165- return this . props . overmind . tree . trackScope (
166- ( ) => originalRender . call ( this ) ,
167- this . props . overmind . onUpdate
168- )
165+ if ( this . props . overmind ) {
166+ return this . props . overmind . tree . trackScope (
167+ ( ) => originalRender . call ( this ) ,
168+ this . props . overmind . onUpdate
169+ )
170+ }
171+
172+ return originalRender . call ( this )
169173 }
170174 }
171175
You can’t perform that action at this time.
0 commit comments