Skip to content

Commit bca2d2b

Browse files
authored
Provide migration instructions for ref(refName)
1 parent 290f40a commit bca2d2b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/guides/migration-from-2-to-3.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ expect(wrapper.ref('abc')).toBeInstanceOf(Box);
359359
In our experience, this is most often what people would actually want and expect out of the `.ref(...)`
360360
method.
361361

362+
To get the wrapper that was returned by enzyme 2:
363+
```js
364+
const wrapper = mount(<Bar />);
365+
const refWrapper = wrapper.findWhere(n => n.instance() === wrapper.ref('abc'));
366+
```
362367

363368
## With `mount`, `.instance()` can be called at any level of the tree
364369

0 commit comments

Comments
 (0)