Skip to content

chore: prefix the CSS lifecycle callbacks with onCSS - #10273

Merged
MatiPl01 merged 1 commit into
mainfrom
@matipl01/css-callbacks-oncss-rename
Aug 13, 2026
Merged

MatiPl01 merged 1 commit into
mainfrom
@matipl01/css-callbacks-oncss-rename

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Renames the eight CSS lifecycle callbacks: onAnimationStart becomes onCSSAnimationStart, onTransitionRun becomes onCSSTransitionRun, and so on.

onAnimationStart and friends read as if they cover any Reanimated animation.
They fire only for CSS animations and transitions, so the name says so.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 87e60f51-90cd-47d5-bfa4-a5279ba5afa6

📥 Commits

Reviewing files that changed from the base of the PR and between 65b0003 and 99862f0.

📒 Files selected for processing (13)
  • apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsx
  • packages/react-native-reanimated/src/css/native/events/__tests__/mask.test.ts
  • packages/react-native-reanimated/src/css/native/events/mask.ts
  • packages/react-native-reanimated/src/css/native/managers/__tests__/CSSCallbacksManager.test.ts
  • packages/react-native-reanimated/src/css/native/managers/__tests__/CSSManager.test.ts
  • packages/react-native-reanimated/src/css/types/animation.ts
  • packages/react-native-reanimated/src/css/types/transition.ts
  • packages/react-native-reanimated/src/css/utils/__tests__/props.test.ts
  • packages/react-native-reanimated/src/css/utils/guards.ts
  • packages/react-native-reanimated/src/css/web/managers/CSSAnimationsManager.ts
  • packages/react-native-reanimated/src/css/web/managers/CSSTransitionsManager.ts
  • packages/react-native-reanimated/src/css/web/managers/__tests__/CSSAnimationsManager.web.test.ts
  • packages/react-native-reanimated/src/css/web/managers/__tests__/CSSTransitionsManager.web.test.ts

📝 Walkthrough

Summary by CodeRabbit

  • Breaking Changes

    • Renamed CSS animation callbacks to use the onCSSAnimation* prefix.
    • Renamed CSS transition callbacks to use the onCSSTransition* prefix.
    • Update existing callback properties to the new names to maintain animation and transition event handling.
  • Bug Fixes

    • Improved consistency of callback recognition and event delivery across native and web implementations.

Walkthrough

CSS animation and transition callback props now use onCSSAnimation* and onCSSTransition* names across public types, event mappings, guards, managers, tests, and the animation example.

Changes

CSS callback prop renaming

Layer / File(s) Summary
Callback contracts and mappings
packages/react-native-reanimated/src/css/types/*, packages/react-native-reanimated/src/css/utils/guards.ts, packages/react-native-reanimated/src/css/native/events/mask.ts, packages/react-native-reanimated/src/css/web/managers/*
Renamed animation and transition callback properties and updated native and web event mappings.
Native callback routing validation
packages/react-native-reanimated/src/css/native/managers/__tests__/*, packages/react-native-reanimated/src/css/native/events/__tests__/mask.test.ts
Updated native tests for callback registration, routing, delivery, removal, detachment, cleanup, and isolation.
Web callback routing validation
packages/react-native-reanimated/src/css/web/managers/__tests__/*
Updated web tests for listener management, event forwarding, bubbling, callback replacement, and cleanup.
Prop validation and example updates
packages/react-native-reanimated/src/css/utils/__tests__/props.test.ts, apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsx
Updated property extraction, validation, warning, and example coverage for the renamed callback props.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 99862

This PR renames CSS lifecycle callbacks consistently across their types, implementations, examples, and tests without changing behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

Suggested reviewers: tjzel

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the onCSS prefix to CSS lifecycle callbacks.
Description check ✅ Passed The description directly explains the callback renames and matches the pull request changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch @matipl01/css-callbacks-oncss-rename

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MatiPl01
MatiPl01 requested review from pawicao and tjzel August 13, 2026 15:23
@MatiPl01
MatiPl01 merged commit 7f12a85 into main Aug 13, 2026
20 checks passed
@MatiPl01
MatiPl01 deleted the @matipl01/css-callbacks-oncss-rename branch August 13, 2026 15:29
MatiPl01 added a commit that referenced this pull request Aug 14, 2026
CSS lifecycle callbacks arrived inside `style`, which never worked well:
functions do not survive `StyleSheet.create`, so they forced the
style-array-with-inline-object shape forever, and `CSSStyle` had to
`Omit` them and merge them back through `CSSConfigProps`.

They are now props on the animated component, matching React DOM, which
spells the same events as props. Each prop carries a JSDoc block stating
what drives it, what does not, and the payload shape.

The manager reads the callbacks off the props it is already handed
rather than a picked-out copy, so a component update walks its props
once instead of twice.

Stacked on #10273, which does the rename.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants