diff --git a/packages/react/src/iconify.ts b/packages/react/src/iconify.ts index aaf42c6..95fa002 100644 --- a/packages/react/src/iconify.ts +++ b/packages/react/src/iconify.ts @@ -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(); diff --git a/packages/react/tests/api/10-api-mock.test.js b/packages/react/tests/api/10-api-mock.test.js index 39871e9..b7baf8c 100644 --- a/packages/react/tests/api/10-api-mock.test.js +++ b/packages/react/tests/api/10-api-mock.test.js @@ -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'; diff --git a/packages/react/tests/api/20-rendering-from-api.test.js b/packages/react/tests/api/20-rendering-from-api.test.js index 0f66f69..c002c51 100644 --- a/packages/react/tests/api/20-rendering-from-api.test.js +++ b/packages/react/tests/api/20-rendering-from-api.test.js @@ -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'; diff --git a/packages/react/tests/api/30-changing-props.test.js b/packages/react/tests/api/30-changing-props.test.js index 734a509..8201afb 100644 --- a/packages/react/tests/api/30-changing-props.test.js +++ b/packages/react/tests/api/30-changing-props.test.js @@ -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'; diff --git a/packages/react/tests/api/30-ref.test.js b/packages/react/tests/api/30-ref.test.js index 6ea39a9..81024f5 100644 --- a/packages/react/tests/api/30-ref.test.js +++ b/packages/react/tests/api/30-ref.test.js @@ -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'; diff --git a/packages/react/tests/api/load.js b/packages/react/tests/api/load.js index d179943..215edc7 100644 --- a/packages/react/tests/api/load.js +++ b/packages/react/tests/api/load.js @@ -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 diff --git a/packages/react/tests/iconify/10-basic.test.js b/packages/react/tests/iconify/10-basic.test.js index 6ddef24..beaec32 100644 --- a/packages/react/tests/iconify/10-basic.test.js +++ b/packages/react/tests/iconify/10-basic.test.js @@ -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 = { diff --git a/packages/react/tests/iconify/10-empty.test.js b/packages/react/tests/iconify/10-empty.test.js index 4c2854a..6216f70 100644 --- a/packages/react/tests/iconify/10-empty.test.js +++ b/packages/react/tests/iconify/10-empty.test.js @@ -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', () => { diff --git a/packages/react/tests/iconify/20-attributes.test.js b/packages/react/tests/iconify/20-attributes.test.js index e3623b7..f8fec54 100644 --- a/packages/react/tests/iconify/20-attributes.test.js +++ b/packages/react/tests/iconify/20-attributes.test.js @@ -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 = { diff --git a/packages/react/tests/iconify/20-dimensions.test.js b/packages/react/tests/iconify/20-dimensions.test.js index 27f3718..887ddf9 100644 --- a/packages/react/tests/iconify/20-dimensions.test.js +++ b/packages/react/tests/iconify/20-dimensions.test.js @@ -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 = { diff --git a/packages/react/tests/iconify/20-ids.test.js b/packages/react/tests/iconify/20-ids.test.js index f3bf3d8..22100a0 100644 --- a/packages/react/tests/iconify/20-ids.test.js +++ b/packages/react/tests/iconify/20-ids.test.js @@ -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 = { diff --git a/packages/react/tests/iconify/20-inline.test.js b/packages/react/tests/iconify/20-inline.test.js index c8a1d1c..9d62fd9 100644 --- a/packages/react/tests/iconify/20-inline.test.js +++ b/packages/react/tests/iconify/20-inline.test.js @@ -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 = { diff --git a/packages/react/tests/iconify/20-ref.test.js b/packages/react/tests/iconify/20-ref.test.js index 01b2931..2276549 100644 --- a/packages/react/tests/iconify/20-ref.test.js +++ b/packages/react/tests/iconify/20-ref.test.js @@ -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 = { diff --git a/packages/react/tests/iconify/20-transformations.test.js b/packages/react/tests/iconify/20-transformations.test.js index 7a513f4..020d924 100644 --- a/packages/react/tests/iconify/20-transformations.test.js +++ b/packages/react/tests/iconify/20-transformations.test.js @@ -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 = { diff --git a/packages/react/tests/offline/10-basic.test.js b/packages/react/tests/offline/10-basic.test.js index 168efd7..e78fdbf 100644 --- a/packages/react/tests/offline/10-basic.test.js +++ b/packages/react/tests/offline/10-basic.test.js @@ -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 = { diff --git a/packages/react/tests/offline/10-empty.test.js b/packages/react/tests/offline/10-empty.test.js index cae57a3..5dd2b83 100644 --- a/packages/react/tests/offline/10-empty.test.js +++ b/packages/react/tests/offline/10-empty.test.js @@ -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', () => { diff --git a/packages/react/tests/offline/20-attributes.test.js b/packages/react/tests/offline/20-attributes.test.js index 6be150d..63d0792 100644 --- a/packages/react/tests/offline/20-attributes.test.js +++ b/packages/react/tests/offline/20-attributes.test.js @@ -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 = { diff --git a/packages/react/tests/offline/20-dimensions.test.js b/packages/react/tests/offline/20-dimensions.test.js index 0924f22..583bd74 100644 --- a/packages/react/tests/offline/20-dimensions.test.js +++ b/packages/react/tests/offline/20-dimensions.test.js @@ -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 = { diff --git a/packages/react/tests/offline/20-ids.test.js b/packages/react/tests/offline/20-ids.test.js index 6733cf1..f107048 100644 --- a/packages/react/tests/offline/20-ids.test.js +++ b/packages/react/tests/offline/20-ids.test.js @@ -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 = { diff --git a/packages/react/tests/offline/20-inline.test.js b/packages/react/tests/offline/20-inline.test.js index 7d8ab68..a476fa3 100644 --- a/packages/react/tests/offline/20-inline.test.js +++ b/packages/react/tests/offline/20-inline.test.js @@ -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 = { diff --git a/packages/react/tests/offline/20-ref.test.js b/packages/react/tests/offline/20-ref.test.js index 3e3d6e2..10e5605 100644 --- a/packages/react/tests/offline/20-ref.test.js +++ b/packages/react/tests/offline/20-ref.test.js @@ -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 = { diff --git a/packages/react/tests/offline/20-storage.test.js b/packages/react/tests/offline/20-storage.test.js index fc79a39..22769d0 100644 --- a/packages/react/tests/offline/20-storage.test.js +++ b/packages/react/tests/offline/20-storage.test.js @@ -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 = { diff --git a/packages/react/tests/offline/20-transformations.test.js b/packages/react/tests/offline/20-transformations.test.js index e9fcffc..c5615d6 100644 --- a/packages/react/tests/offline/20-transformations.test.js +++ b/packages/react/tests/offline/20-transformations.test.js @@ -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 = {