react-display-name

WebJar for react-display-name

Лицензия

Лицензия

MIT
Категории

Категории

React Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

react-display-name
Последняя версия

Последняя версия

0.2.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

react-display-name
WebJar for react-display-name
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jurassix/react-display-name

Скачать react-display-name

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/react-display-name/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>react-display-name</artifactId>
    <version>0.2.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/react-display-name/
implementation 'org.webjars.npm:react-display-name:0.2.5'
// https://jarcasting.com/artifacts/org.webjars.npm/react-display-name/
implementation ("org.webjars.npm:react-display-name:0.2.5")
'org.webjars.npm:react-display-name:jar:0.2.5'
<dependency org="org.webjars.npm" name="react-display-name" rev="0.2.5">
  <artifact name="react-display-name" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='react-display-name', version='0.2.5')
)
libraryDependencies += "org.webjars.npm" % "react-display-name" % "0.2.5"
[org.webjars.npm/react-display-name "0.2.5"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.
npm install --save react-display-name

Get the displayName from a Component. This is a common pattern with React Higher Order Components (HoCs). This is a simple reusable utility to get the name of a component.

Usage:

import {expect} from 'chai';
import React, {Component} from 'react';
import getDisplayName from 'react-display-name';

const container = (WrappedComponent) => {
  class Container extends Component {
    static displayName = `Container(${getDisplayName(WrappedComponent)})`;
    render() {
      return (
        <WrappedComponent />
      );
    }
  }
  return Container;
}

class HelloWorld extends Component {
  render() {
    return (
      <div>Hello</div>
    );
  }
}

const HelloWorldPrime = container(HelloWorld);

expect(getDisplayName(HelloWorldPrime)).to.equal('Container(HelloWorld)');
expect(HelloWorldPrime.displayName).to.equal('Container(HelloWorld)');

Версии библиотеки

Версия
0.2.5
0.2.4