A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://enzymejs.github.io/enzyme/docs/api/ShallowWrapper/state.html below:

state([key]) ยท Enzyme

.state([key]) => Any

Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value.

Arguments
  1. key (String [optional]): If provided, the return value will be the this.state[key] of the root component instance.
Example
const wrapper = shallow(<MyComponent />);
expect(wrapper.state().foo).to.equal(10);
expect(wrapper.state('foo')).to.equal(10);
Related Methods

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4