Memoize
This commit is contained in:
@@ -89,7 +89,11 @@ export function GlobalDialog() {
|
|||||||
popTopDialog()
|
popTopDialog()
|
||||||
}, [popTopDialog])
|
}, [popTopDialog])
|
||||||
|
|
||||||
return activeDialogs.map(({component: Comp, props, options}, i) => {
|
return React.useMemo(
|
||||||
return <Comp key={i} {...props} cleanup={cleanup} options={options} />
|
() =>
|
||||||
})
|
activeDialogs.map(({component: Comp, props, options}, i) => {
|
||||||
|
return <Comp key={i} {...props} cleanup={cleanup} options={options} />
|
||||||
|
}),
|
||||||
|
[activeDialogs, cleanup],
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user