#react-lottie getting errors when using it

1 messages · Page 1 of 1 (latest)

glacial osprey
#

I'm trying to use react-lottie inside an use client component. I'm getting TypeError: Cannot read properties of undefined (reading 'length') and I dont know what I have to do, this is my wrapper component.

'use client'
import LT, { LottieComponentProps } from 'lottie-react'

export default function Lottie(props: LottieComponentProps) {
  return <LT {...props} />
}

vast sorrelBOT
#

Hi @glacial osprey. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. The error message you're seeing typically indicates that you're trying to access a property of an object that hasn't been defined yet. However, without more context, it's hard to pinpoint the exact cause of the issue.

The code you've provided seems to be a wrapper for the LottieComponent from the lottie-react library. If the error is originating from this component, it might be related to the props you're passing to it. Make sure that the props object you're spreading into the LottieComponent is defined and contains the necessary properties.

If you're still having trouble, I would recommend checking the official documentation or reaching out to the maintainers of the lottie-react library for more specific guidance.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: