mirror of
https://github.com/iconify/iconify.git
synced 2025-01-06 07:20:40 +00:00
Few small changes to React component
This commit is contained in:
parent
e9dc3803e4
commit
73cec2ac80
@ -2,7 +2,6 @@ import React from 'react';
|
||||
import type { IconifyJSON } from '@iconify/types';
|
||||
|
||||
// Core
|
||||
import { stringToIcon } from '@iconify/core/lib/icon/name';
|
||||
import type { IconifyIconName } from '@iconify/core/lib/icon/name';
|
||||
import type {
|
||||
IconifyIconSize,
|
||||
@ -111,6 +110,7 @@ export {
|
||||
GetAPIConfig,
|
||||
IconifyAPIPrepareQuery,
|
||||
IconifyAPISendQuery,
|
||||
PartialIconifyAPIConfig,
|
||||
};
|
||||
|
||||
/* Browser cache */
|
||||
@ -353,7 +353,11 @@ class IconComponent extends React.Component<
|
||||
const icon = this.props.icon;
|
||||
|
||||
// Icon is an object
|
||||
if (typeof icon === 'object' && typeof icon.body === 'string') {
|
||||
if (
|
||||
typeof icon === 'object' &&
|
||||
icon !== null &&
|
||||
typeof icon.body === 'string'
|
||||
) {
|
||||
// Stop loading
|
||||
this._icon = '';
|
||||
this._abortLoading();
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { loadIcons, iconExists } from '../../lib/iconify';
|
||||
import { loadIcons, iconExists } from '../../dist/iconify';
|
||||
import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
||||
import { provider, nextPrefix } from './load';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { Icon, loadIcons, iconExists } from '../../lib/iconify';
|
||||
import { Icon, loadIcons, iconExists } from '../../dist/iconify';
|
||||
import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
||||
import { provider, nextPrefix } from './load';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { Icon, iconExists } from '../../lib/iconify';
|
||||
import { Icon, iconExists } from '../../dist/iconify';
|
||||
import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
||||
import { provider, nextPrefix } from './load';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { Icon, InlineIcon, loadIcons, iconExists } from '../../lib/iconify';
|
||||
import { Icon, InlineIcon, loadIcons, iconExists } from '../../dist/iconify';
|
||||
import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
||||
import { provider, nextPrefix } from './load';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { _api, addAPIProvider } from '../../lib/iconify';
|
||||
import { _api, addAPIProvider } from '../../dist/iconify';
|
||||
import { mockAPIModule } from '@iconify/core/lib/api/modules/mock';
|
||||
|
||||
// API provider for tests
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, InlineIcon } from '../../lib/iconify';
|
||||
import { Icon, InlineIcon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../../lib/iconify';
|
||||
import { Icon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
describe('Empty icon', () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, InlineIcon } from '../../lib/iconify';
|
||||
import { Icon, InlineIcon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { InlineIcon } from '../../lib/iconify';
|
||||
import { InlineIcon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../../lib/iconify';
|
||||
import { Icon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconDataWithID = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../../lib/iconify';
|
||||
import { Icon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, InlineIcon } from '../../lib/iconify';
|
||||
import { Icon, InlineIcon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { InlineIcon } from '../../lib/iconify';
|
||||
import { InlineIcon } from '../../dist/iconify';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, InlineIcon } from '../../lib/offline';
|
||||
import { Icon, InlineIcon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../../lib/offline';
|
||||
import { Icon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
describe('Empty icon', () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, InlineIcon } from '../../lib/offline';
|
||||
import { Icon, InlineIcon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { InlineIcon } from '../../lib/offline';
|
||||
import { InlineIcon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../../lib/offline';
|
||||
import { Icon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconDataWithID = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../../lib/offline';
|
||||
import { Icon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, InlineIcon } from '../../lib/offline';
|
||||
import { Icon, InlineIcon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, addIcon, addCollection } from '../../lib/offline';
|
||||
import { Icon, addIcon, addCollection } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { InlineIcon } from '../../lib/offline';
|
||||
import { InlineIcon } from '../../dist/offline';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
const iconData = {
|
||||
|
Loading…
Reference in New Issue
Block a user