You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`options.disableLifecycleMethods`: (`Boolean`[optional]): If set to true, `componentDidMount`
51
51
is not called on the component, and `componentDidUpdate` is not called after
52
52
[`setProps`](ShallowWrapper/setProps.md) and [`setContext`](ShallowWrapper/setContext.md). Default to `false`.
53
-
-`options.wrappingComponent`: (`ComponentType`[optional]): A component that will render as a parent of the `node`. It can be used to provide context to the `node`, among other things. See the [`getWrappingComponent()` docs](ShallowWrapper/getWrappingComponent.md) for an example. **Note**: `wrappingComponent`_must_ render its children.
54
-
-`options.wrappingComponentProps`: (`Object`[optional]): Initial props to pass to the `wrappingComponent` if it is specified.
53
+
-`options.wrappingComponent`: (`ComponentType`[optional]): A component that will render as a parent of the `node`. It can be used to provide context to the `node`, among other things. See the [`getWrappingComponent()` docs](ShallowWrapper/getWrappingComponent.md) for an example. **Note**: `wrappingComponent`_must_ render its children.
54
+
-`options.wrappingComponentProps`: (`Object`[optional]): Initial props to pass to the `wrappingComponent` if it is specified.
55
+
-`options.suspenseFallback`: (`Boolean`[optional]): If set to true, when rendering `Suspense` enzyme will replace all the lazy components in children with `fallback` element prop. Otherwise it won't handle fallback of lazy component. Default to `true`. Note: not supported in React < 16.6.
Copy file name to clipboardExpand all lines: docs/guides/migration-from-2-to-3.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,49 @@ Although this is a breaking change, I believe the new behavior is closer to what
102
102
actually expect and want. Having enzyme wrappers be immutable results in more deterministic tests
103
103
that are less prone to flakiness from external factors.
104
104
105
+
### Calling `props()` after a state change
106
+
107
+
In `enzyme` v2, executing an event that would change a component state (and in turn update props) would return those updated props via the `.props` method.
108
+
109
+
Now, in `enzyme` v3, you are required to re-find the component; for example:
0 commit comments