Skip to content

Commit

Permalink
[Docs] Provide migration instructions for ref(refName)
Browse files Browse the repository at this point in the history
  • Loading branch information
robrichard authored and ljharb committed Jan 10, 2018
1 parent 7869527 commit 38acea4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/guides/migration-from-2-to-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(<Bar />);
const refWrapper = wrapper.findWhere(n => n.instance() === wrapper.ref('abc'));
```

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

Expand Down

0 comments on commit 38acea4

Please sign in to comment.