Added a new event to fire when the internal instance of the animation has been set. This is to avoid confusion with the load event, as load fires when Lottie has fired DOMLoaded, but setting the state of the react player has not yet been set, causing confusion when the player doesn't perform as expected in the user event handler.
Where the 'load' event was firing, but 'setState(instance)' had not yet completed, thus when we caught the 'load' event and tried player.play(), the method would fail as the instance was not yet set.
Type of change
[x] Patch: Bug (non-breaking change which fixes an issue)
[ ] Minor: New feature (non-breaking change which adds functionality)
[ ] Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)
Description
Added a new event to fire when the internal instance of the animation has been set. This is to avoid confusion with the load event, as load fires when Lottie has fired DOMLoaded, but setting the state of the react player has not yet been set, causing confusion when the player doesn't perform as expected in the user event handler.
This PR is a fix directed towards this issue
For context: https://stackoverflow.com/questions/75213109/why-lottieref-returns-only-null
Where the 'load' event was firing, but 'setState(instance)' had not yet completed, thus when we caught the 'load' event and tried player.play(), the method would fail as the instance was not yet set.
Type of change
Checklist