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/name.html below:

name() ยท Enzyme

.name() => String|null

Returns the name of the current node of this wrapper. If it's a composite component, this will be the name of the top-most rendered component. If it's a native DOM node, it will be a string of the tag name. If it's null, it will be null.

The order of precedence on returning the name is: type.displayName -> type.name -> type.

Note: can only be called on a wrapper of a single node.

Returns

String|null: The name of the current node

Examples
const wrapper = shallow(<div />);
expect(wrapper.name()).to.equal('div');
function SomeWrappingComponent() {
  return <Foo />;
}
const wrapper = shallow(<SomeWrappingComponent />);
expect(wrapper.name()).to.equal('Foo');
Foo.displayName = 'A cool custom name';
function SomeWrappingComponent() {
  return <Foo />;
}
const wrapper = shallow(<SomeWrappingComponent />);
expect(wrapper.name()).to.equal('A cool custom name');

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