react-lottie 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.0.1](https://github.com/chenqingspring/react-lottie/compare/v2.0.0...v2.0.1) (2026-11-05)
6
+
7
+ ### Bug Fixes
8
+
9
+ * apply the `segments` prop on mount, so an animation starts inside the requested range instead of playing the full timeline until the prop changes; an animation created with `autoplay: false` stays paused at the start of the range
10
+
5
11
  ## [2.0.0](https://github.com/chenqingspring/react-lottie/compare/v1.2.10...v2.0.0) (2026-11-04)
6
12
 
7
13
  This release folds in the changes that were prepared as 1.2.11 (never
package/dist/index.js CHANGED
@@ -79,6 +79,17 @@ var Lottie = exports["default"] = /*#__PURE__*/function (_React$Component) {
79
79
  this.setSpeed();
80
80
  this.setDirection();
81
81
 
82
+ /* Apply a segment passed on mount. The component otherwise only reacts to
83
+ `segments` changes, so the animation used to play the whole timeline
84
+ until the prop was updated. */
85
+ if (this.props.segments && this.props.segments.length === 2) {
86
+ var wasPaused = this.anim.isPaused;
87
+ this.playSegments();
88
+ if (wasPaused) {
89
+ this.pause();
90
+ }
91
+ }
92
+
82
93
  /* Apply the initial playback props, which are otherwise only read on update */
83
94
  if (this.props.isStopped) {
84
95
  this.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-lottie",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "funding": "https://opencollective.com/react-lottie",
5
5
  "description": "lottie animation view for React",
6
6
  "repository": {