| 970 | } |
| 971 | |
| 972 | protected _onChange(value: T, idle?: boolean) { |
| 973 | // Hand `onChange` a real AnimationResult so `result.value` matches the |
| 974 | // advertised type, mirroring how `onStart`/`onRest` dispatch their results. |
| 975 | // See #2183. |
| 976 | const result = getFinishedResult(value, false) |
| 977 | if (!idle) { |
| 978 | this._onStart() |
| 979 | callProp(this.animation.onChange, result, this) |
| 980 | } |
| 981 | callProp(this.defaultProps.onChange, result, this) |
| 982 | // Keep the internal `change` event raw — fluid observers (the animated |
| 983 | // tree, the Controller) read the value itself, not a result wrapper. |
| 984 | super._onChange(value, idle) |
| 985 | } |
| 986 | |
| 987 | // This method resets the animation state (even if already animating) to |
| 988 | // ensure the latest from/to range is used, and it also ensures this spring |