Fix Reanimated v4 useAnimatedProps type error in AnimatedNumber#563
Merged
Conversation
Co-authored-by: jamespepper81 <84083764+jamespepper81@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add npm install command for project dependencies
Run npm install to populate node_modules
Feb 23, 2026
Copilot
AI
changed the title
Run npm install to populate node_modules
Run npm audit — document dependency vulnerabilities
Feb 23, 2026
…s (Reanimated v4) Co-authored-by: jamespepper81 <84083764+jamespepper81@users.noreply.github.com>
Copilot
AI
changed the title
Run npm audit — document dependency vulnerabilities
Fix Reanimated v4 useAnimatedProps type error in AnimatedNumber
Feb 23, 2026
jamespepper81
approved these changes
Feb 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TypeScript build failure caused by Reanimated v4's stricter type checking for useAnimatedProps. The issue arose because Reanimated v4 tightened the animatedProps prop type, making Partial<{ text: string }> no longer assignable to Partial<AnimatedPropsProp<TextInputProps>> since text is a Reanimated-internal native prop that doesn't exist in React Native's TextInputProps.
Changes:
- Added
defaultValue: textalongsidetextinuseAnimatedPropsreturn object inAnimatedNumber.tsxto satisfy TypeScript type checking - Package-lock.json updated with peer dependency flags on various packages (no version changes)
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| components/AnimatedNumber.tsx | Fixed Reanimated v4 type error by adding defaultValue: text to useAnimatedProps return, following the pattern from Reanimated's PerformanceMonitor |
| package-lock.json | Automated dependency metadata updates (peer flags) with no actual version changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI TypeScript build was failing because Reanimated v4 tightened the
animatedPropsprop type —Partial<{ text: string }>is no longer assignable toPartial<AnimatedPropsProp<TextInputProps>>sincetextis a Reanimated-internal native prop absent from RN'sTextInputProps.Fix
Added
defaultValue: textalongsidetextin theuseAnimatedPropsreturn — the same pattern used in Reanimated's ownPerformanceMonitor.tsx. SincedefaultValueis a standardTextInputPropsfield, TypeScript can now verify structural compatibility.defaultValuealso correctly sets the initial displayed value before the first animation frame runs.npm audit fix --force— not appliedForce-fixing the audit would have downgraded
expov54→v51,@expo/cliv54→v0.11, and pulled in areact-nativeversion incompatible with React 19 — breaking the build worse than before. The 40 high-severity findings are all in theminimatchtransitive chain through dev tooling, not production runtime code.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.