Skip to content

Commit

Permalink
fix: Eslint error for conditional hook call
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 18, 2020
1 parent 83155cc commit 6238799
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/IconGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import IconReference from './IconReference';
const IconGallery = () => {
if (typeof window === 'undefined') global.window = {};

const [search, setSearch] = useState('');

// Get the Icon component when available
const { Icon } = window.__NR1_SDK__?.default ?? {};
if (!Icon) return null;

// Basic search / filtering
const [search, setSearch] = useState('');
const types = Object.keys(Icon.TYPE);
const filterByString = (input) => (str) =>
str.toLowerCase().includes(input.toLowerCase());
Expand Down

0 comments on commit 6238799

Please sign in to comment.