From 6238799f38b1cb040a92ec3163ff808d8c1ad1d7 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Thu, 18 Jun 2020 10:51:05 -0700 Subject: [PATCH] fix: Eslint error for conditional hook call --- src/components/IconGallery.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/IconGallery.js b/src/components/IconGallery.js index 82615b552..0f4197ea7 100644 --- a/src/components/IconGallery.js +++ b/src/components/IconGallery.js @@ -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());