Open sulram opened 2 weeks ago
Hi @sulram, when using display: none
, the width and height of the DotLottieReact canvas are set to zero, causing the error.
You can use the hidden
prop directly on the DotLottieReact
component. This keeps the component in the DOM without rendering it visibly:
<DotLottieReact hidden ... />
also you can use other CSS properties like visibility
or opacity
:
<DotLottieReact style={{ visibility: 'hidden' }} ... />
<DotLottieReact style={{ opacity: 0 }} ... />
Overview
Error that's occuring wrapper with
display:none
and framer motion of a<DotLottieReact />
componentSometimes
Consuming repo
@lottiefiles/dotlottie-react