Spec-Zone.ru › Enzyme

.getElement() => ReactElement

Returns the wrapped ReactElement.

If the current wrapper is wrapping the root component, returns the root component's latest render output.

Returns

ReactElement: The retrieved ReactElement.

Examples

const element = (
  <div>
    <span />
    <span />
  </div>
);

function MyComponent() {
  return element;
}

const wrapper = shallow(<MyComponent />);
expect(wrapper.getElement()).to.equal(element);

Related Methods

  • .getElements() => Array<ReactElement>

© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://enzymejs.github.io/enzyme/docs/api/ShallowWrapper/getElement.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API