Commit 1fb4b6c
Native Animated - Support events using RCT{Direct|Bubbling}EventBlock on iOS (#25317)
Summary:
Reland #15611 and added the gcc warning that was different from fb internal config. The original PR missed the static keyword for the `RCTNormalizeAnimatedEventName` function which triggered the gcc warning internally but not with the OSS xcode config.
When calling a prop of type `RCTDirectEventBlock` or `RCTBubblingEventBlock` it uses a completely different code path than events using `[RCTEventDispatcher sendEvent:]` and those were not dispatched to the `RCTEventDispatcherListener`s. We also do some event name normalization which caused issues between the JS and native event names. To fix that I simply remove the parts we normalize from the event key.
## Changelog:
[iOS] [Fixed] - Support events using RCT{Direct|Bubbling}EventBlock
Pull Request resolved: #25317
Test Plan: Added a Slider (it uses RCTBubblingEventBlock for its onValueChange event) that can control a native animated value in RNTester to reproduce the bug and made sure this diff fixes it.
Differential Revision: D15938856
Pulled By: cpojer
fbshipit-source-id: 7e7a3459e2a2e8b1254a2f1ec8153a159ea73eed1 parent d010fc3 commit 1fb4b6c
File tree
3 files changed
+31
-6
lines changed- Libraries/NativeAnimation
- RCTAnimation.xcodeproj
- RNTester/js/examples/NativeAnimation
3 files changed
+31
-6
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| 570 | + | |
569 | 571 | | |
570 | 572 | | |
571 | 573 | | |
| |||
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
| 624 | + | |
622 | 625 | | |
623 | 626 | | |
624 | 627 | | |
| |||
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
31 | 46 | | |
32 | 47 | | |
33 | 48 | | |
| |||
324 | 339 | | |
325 | 340 | | |
326 | 341 | | |
327 | | - | |
| 342 | + | |
328 | 343 | | |
329 | 344 | | |
330 | 345 | | |
| |||
338 | 353 | | |
339 | 354 | | |
340 | 355 | | |
341 | | - | |
| 356 | + | |
342 | 357 | | |
343 | 358 | | |
344 | 359 | | |
| |||
360 | 375 | | |
361 | 376 | | |
362 | 377 | | |
363 | | - | |
| 378 | + | |
364 | 379 | | |
365 | 380 | | |
366 | 381 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| |||
0 commit comments