chore: memoize components (#607)
This commit is contained in:
parent
906d7d34da
commit
3df0fd4c0f
6 changed files with 123 additions and 53 deletions
|
|
@ -97,12 +97,10 @@ function PureBlockActions({
|
|||
}
|
||||
|
||||
export const BlockActions = memo(PureBlockActions, (prevProps, nextProps) => {
|
||||
if (
|
||||
prevProps.block.status === 'streaming' &&
|
||||
nextProps.block.status === 'streaming'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (prevProps.block.status !== nextProps.block.status) return false;
|
||||
if (prevProps.currentVersionIndex !== nextProps.currentVersionIndex)
|
||||
return false;
|
||||
if (prevProps.isCurrentVersion !== nextProps.isCurrentVersion) return false;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue