![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@skbkontur/react-icons
Advanced tools
Для использования иконок необходимо установить пакет @skbkontur/react-icons
.
В конфиге вебпака требуется настроить css-loader с включенными модулями.
В 4.0 исходный код иконок распространяется в виде ES6 модулей. Это необходимо для обеспечения правильной работы tree-shaking.
Кроме этого все иконки доступны в виде именованного импорта из корня.
Если вы загружаете компоненты библиотеки в nodejs, например, в unit тестах, вам необходимо настроить трансформацию в CommonJS модулей из @skbkontur/react-icons
, чтобы избежать ошибки Error [ERR_REQUIRE_ESM]: Must use import to load ES Module
. Для сборки бандла в webpack конфиге ничего дополнительно настраивать не нужно. В скором времени появится нативная поддержка ES Modules в Jest
type IconProps = {
color?: string;
name: IconName; // только для компонента Icon
size?: number | string;
disableCompensation?: boolean;
};
type IconName =
| 'Menu'
| 'Add'
| 'ArchivePack'
| 'ArchiveUnpack'
| 'Attach'
| 'Baby'
| 'Backward'
| 'BarcodeScanner'
| 'Briefcase'
| 'Calculator'
| 'Calendar'
| 'Card'
| 'Certificate'
| 'Clear'
| ... 218 more ...
| 'Infiniti';
Вся коллекция иконок доступна на гайдах. Там есть удобный поиск по иконам
Для уменьшения размера бандла рекомендуется использовать компонент с конкретной иконкой
import { Icon } from './';
import { Ok } from './icons/Ok';
<div>
<Ok size={16} color="red" />
<Icon name="Ok" size={24} color="blue" />
<Icon.Ok size={32} color="green" />
</div>;
Список изменений доступен по ссылке ссылке
import { Icon } from './';
<div>
<div style={{ columns: '3' }}>
{Object.keys(Icon).map(name => {
return (
<div style={{ margin: '2px' }}>
<Icon name={name} />
<span style={{ marginLeft: '2px' }}> - {name}</span>
</div>
);
})}
</div>
</div>;
FAQs
React SVG icons
The npm package @skbkontur/react-icons receives a total of 10 weekly downloads. As such, @skbkontur/react-icons popularity was classified as not popular.
We found that @skbkontur/react-icons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.