File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/enzyme-adapter-react-16/src Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,22 @@ class ReactSixteenAdapter extends EnzymeAdapter {
175175 instance . setChildProps ( el . props , context , callback ) ;
176176 }
177177 } ,
178+ hydrate ( el , context , callback ) {
179+ if ( instance === null ) {
180+ const ReactWrapperComponent = createMountWrapper ( el , options ) ;
181+ const wrappedEl = React . createElement ( ReactWrapperComponent , {
182+ Component : el . type ,
183+ props : el . props ,
184+ context,
185+ } ) ;
186+ instance = ReactDOM . hydrate ( wrappedEl , domNode ) ;
187+ if ( typeof callback === 'function' ) {
188+ callback ( ) ;
189+ }
190+ } else {
191+ instance . setChildProps ( el . props , context , callback ) ;
192+ }
193+ } ,
178194 unmount ( ) {
179195 ReactDOM . unmountComponentAtNode ( domNode ) ;
180196 instance = null ;
You can’t perform that action at this time.
0 commit comments