-
Notifications
You must be signed in to change notification settings - Fork 14
Usage with React - Documentation/Clarification #22
Comments
Hi James, The react wrapper you linked to would definitely work. We have tried to make jLottie's API as close to the current player's as possible. The methods available and their usage is documented in the main readme. I have also just pushed an edit to it documenting the events dispatched. There should now be enough to build your react wrapper. Keep us updated on how it goes. Throw us any queries, or discuss the expansion of jLottie API further, over at https://discord.gg/BVB2GrUb |
It seems like this is related. I can't get jLottie to load my json-animation. Any ideas?
|
This problem is arising from jLottie assuming that animationData always contains a string literal (and thereafter parsing it to a JSON object every time). Hence, the following works for now: function App() { return ( ); } I will push up a fix that explicitly checks animationData to see if its a string literal, and only then parse it. |
Thanks @shaafiee After navigating back to the page: |
Would you be able to share the source for this animation? I could look at it and let you know exactly what features are not being supported - or workarounds, if any. Unfortunately, at this time jLottie supports a limited number of features, so you will run into these issues with quite a few animations. |
It's only a test file I found on Lottie Files: But its kind of weird that it breaks after navigating back to the page... |
Just an update:
|
Would like to follow up on the last comment: does the same issue persist? |
I'd like to explore using this new player in a React codebase.
Looking through the issues on the lottie-web player repo, I found this suggestion for creating a react wrapper: https://gist.github.com/olso/0d2aeff411092627a3fdba6fb6dac406
Will that approach work with jlottie? The API seems to be identical, so I'm hoping yes.
Thanks in advance! Excited to use the new and improved player 😎
The text was updated successfully, but these errors were encountered: