Back to Enzyme

`.first() => ReactWrapper`

docs/api/ReactWrapper/first.md

2.9.1465 B
Original Source

.first() => ReactWrapper

Reduce the set of matched nodes to the first in the set, just like .at(0).

Returns

ReactWrapper: A new wrapper that wraps the first node in the set.

Examples

jsx
const wrapper = mount(<MyComponent />);
expect(wrapper.find(Foo).first().props().foo).to.equal('bar');

Related Methods