Repository navigation
Commit 104ed60
fix: apply Reanimated styles passed to Searchbar's style prop
Broadening the `style` type wasn't enough on its own: `StyleSheet.flatten`
silently drops the opaque handle `useAnimatedStyle` returns, so the animated
values never reached a view.
Now that `Surface` is Reanimated-based (#5078), split `style` into the entries
that can be read during render and the ones that can't. Static entries keep
being flattened and split between the wrapper and the `Surface` as before;
animated entries — the `useAnimatedStyle` handle, or an object holding shared
values — are forwarded untouched to the outer `Reanimated.View`, which is where
their static counterparts (layout, margins, transform, opacity) already go.
`style` is typed as `StyleProp<SurfaceStyle>` so the properties `Surface` now
takes as props are rejected at the type level instead of being ignored.
One caveat, documented on the prop: an animated horizontal margin can't be read
during render, so it doesn't replace the built-in focus margin the way a static
one does.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXgTWJSnvLKQZ2Kkw1Qhkj1 parent 2d3e072 commit 104ed60
2 files changed
Lines changed: 117 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
86 | 137 | | |
87 | 138 | | |
88 | 139 | | |
| |||
175 | 226 | | |
176 | 227 | | |
177 | 228 | | |
178 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
179 | 241 | | |
180 | 242 | | |
181 | 243 | | |
| |||
343 | 405 | | |
344 | 406 | | |
345 | 407 | | |
| 408 | + | |
| 409 | + | |
346 | 410 | | |
347 | 411 | | |
348 | | - | |
349 | 412 | | |
350 | | - | |
| 413 | + | |
351 | 414 | | |
352 | 415 | | |
353 | 416 | | |
354 | | - | |
| 417 | + | |
355 | 418 | | |
356 | 419 | | |
357 | 420 | | |
358 | | - | |
| 421 | + | |
359 | 422 | | |
360 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
361 | 428 | | |
362 | 429 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 430 | + | |
367 | 431 | | |
368 | 432 | | |
369 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
11 | 37 | | |
12 | 38 | | |
13 | 39 | | |
| |||
271 | 297 | | |
272 | 298 | | |
273 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
274 | 317 | | |
275 | 318 | | |
276 | 319 | | |
| |||
0 commit comments