Commit eac7b77
Fix TabBar accent animation initialization in useTabs hook (#14072)
## Summary
Updated the TabBar accent animation initialization to use the `from`
property instead of `to` with `immediate: true` in the useSpring hook
configuration.
## Key Changes
- Changed `useSpring` initial animation configuration from `to: { top:
0, left: 0, width: 0 }` with `immediate: true` to `from: { top: 0, left:
0, width: 0 }`
- This ensures the accent bar starts from the correct initial state (0,
0, 0) before animating to the active tab position
## Implementation Details
The `from` property in react-spring defines the starting point of an
animation, which is more semantically correct than using `to` with
`immediate: true`. This change improves the animation lifecycle by
properly establishing the initial state before any animated transitions
occur, resulting in more predictable and correct accent bar positioning
behavior.
https://claude.ai/code/session_017YQMNfGhGb5tU4e5v9iW9o
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a750794 commit eac7b77
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
| 137 | + | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
| |||
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
0 commit comments