Fix performance problem with defaulting to []
This commit is contained in:
parent
bbb752fa65
commit
d2c672667d
1 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ export default function useOutfitAppearance(outfitState) {
|
||||||
);
|
);
|
||||||
|
|
||||||
const petAppearance = data1?.petAppearance;
|
const petAppearance = data1?.petAppearance;
|
||||||
const items = data2?.items || [];
|
const items = data2?.items;
|
||||||
const itemAppearances = React.useMemo(
|
const itemAppearances = React.useMemo(
|
||||||
() => (items || []).map((i) => i.appearance),
|
() => (items || []).map((i) => i.appearance),
|
||||||
[items]
|
[items]
|
||||||
|
@ -104,7 +104,7 @@ export default function useOutfitAppearance(outfitState) {
|
||||||
loading: loading1 || loading2,
|
loading: loading1 || loading2,
|
||||||
error: error1 || error2,
|
error: error1 || error2,
|
||||||
petAppearance,
|
petAppearance,
|
||||||
items,
|
items: items || [],
|
||||||
itemAppearances,
|
itemAppearances,
|
||||||
visibleLayers,
|
visibleLayers,
|
||||||
bodyId,
|
bodyId,
|
||||||
|
|
Loading…
Reference in a new issue