Releases: developertown/react-lottie-hook
Package Upgrades
0.2.0
Version 0.2.0 - separation of state and controls.
Upgrades all dependencies.
Moves example into an examples folder and added an extra repo demo.
react-lottie-hook no longer has react and react-dom as dependencies.
Previous yarn resolutions no longer necessary and remvoed.
New controls were added:
- setSpeed
- resize
- goToAndPlay
- goToAndStop
- setSubframe
- getDuration
Internal state is validated to exists on the exposed state in order to make sure that only existing properties are exposed.
0.1.1
0.1.0
Releasing v0.1.0 with workspaces.
Workspaces were added to allow development of the library in conjunction with a demo project under the example directory. The actual library now exists inside of the react-lottie-hook directory.
There are many improvements coming with this release.
- Better usaged of react hooks
- Additional typings
This release also fixes an issue with the eventListeners configuration option passed to useLottie and the eventListeners type has been converted from an array to an object; which mean that instead of passing an array of objects with properties eventName and callback you will need to pass object keys that correspond to lottie defined eventNames and the callbacks as their values.
const [lottieRef, state, controls] = useLottie({
// other configurations
eventListeners: {
loopComplete: (data) => console.log('loop completed!),
destroy: (data) => console.log('animation destroyed!'),
},
});Also, useLotties state returns an additional isLoaded boolean indicator along the pre-existing isPaused and isStopped indicators.