mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Do not render Animate when not in need
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
71834e9fb2
commit
5a684513fe
@ -90,9 +90,13 @@ export class Animate extends React.Component<AnimateProps> {
|
||||
"--leave-duration": `${leaveDuration}ms`,
|
||||
} as React.CSSProperties;
|
||||
|
||||
if (!this.isVisible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return React.cloneElement(contentElem, {
|
||||
className: cssNames("Animate", name, contentElem.props.className, this.statusClassName),
|
||||
children: this.isVisible ? contentElem.props.children : null,
|
||||
children: contentElem.props.children,
|
||||
style: {
|
||||
...contentElem.props.style,
|
||||
...durations,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user