From d2c672667dfeca495b81665bfa5d07d23ca6ffc6 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 10 Feb 2021 13:51:59 -0800 Subject: [PATCH] Fix performance problem with defaulting to [] --- src/app/components/useOutfitAppearance.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/useOutfitAppearance.js b/src/app/components/useOutfitAppearance.js index 9b5ffed..7d3086f 100644 --- a/src/app/components/useOutfitAppearance.js +++ b/src/app/components/useOutfitAppearance.js @@ -88,7 +88,7 @@ export default function useOutfitAppearance(outfitState) { ); const petAppearance = data1?.petAppearance; - const items = data2?.items || []; + const items = data2?.items; const itemAppearances = React.useMemo( () => (items || []).map((i) => i.appearance), [items] @@ -104,7 +104,7 @@ export default function useOutfitAppearance(outfitState) { loading: loading1 || loading2, error: error1 || error2, petAppearance, - items, + items: items || [], itemAppearances, visibleLayers, bodyId,