diff --git a/docs/guides/migration-from-2-to-3.md b/docs/guides/migration-from-2-to-3.md index 30fee1865..63d0377c0 100644 --- a/docs/guides/migration-from-2-to-3.md +++ b/docs/guides/migration-from-2-to-3.md @@ -391,6 +391,11 @@ expect(wrapper.ref('abc')).toBeInstanceOf(Box); In our experience, this is most often what people would actually want and expect out of the `.ref(...)` method. +To get the wrapper that was returned by enzyme 2: +```js +const wrapper = mount(); +const refWrapper = wrapper.findWhere(n => n.instance() === wrapper.ref('abc')); +``` ## With `mount`, `.instance()` can be called at any level of the tree