Skip to content

Fix: update FadeInView example to use Animated.Value #4674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

DhruvTheDev1
Copy link
Contributor

@DhruvTheDev1 DhruvTheDev1 commented Jul 11, 2025

Addressed #4654

  • The animation example for TypeScript uses const fadeAnim = useAnimatedValue(0); which is not a real function in the React Native API.
  • TypeError: (0 , _reactNative.useAnimatedValue) is not a function
  • Replaced const fadeAnim = useAnimatedValue(0); with const fadeAnim = new Animated.Value(0);
  • Removed useAnimatedValue import
  • However the original code does work when scanning the QR code for Expo - perhaps due to some internal support? However the code changes still works and fixes the error.

Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit 45fbad2
🔍 Latest deploy log https://app.netlify.com/projects/react-native/deploys/68710e41624fce0008ac9847
😎 Deploy Preview https://deploy-preview-4674--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DhruvTheDev1
Copy link
Contributor Author

@cortinico Hi! Is the code change okay as it is const fadeAnim = new Animated.Value(0); or shall I change it to const fadeAnim = useRef(new Animated.Value(0)).current and add the useRef import?
Based on this - I will update the versioned docs too.

@DhruvTheDev1
Copy link
Contributor Author

DhruvTheDev1 commented Jul 11, 2025

@cortinico Hi! I've updated the code to const fadeAnim = useRef(new Animated.Value(0)).current and added the useRef import. Let me know if it looks good.

…tion example

Accidentally changed JS code snippet
@DhruvTheDev1 DhruvTheDev1 changed the title fix(animations): update FadeInView example to use Animated.Value Fix: update FadeInView example to use Animated.Value Jul 11, 2025
@Simek
Copy link
Collaborator

Simek commented Aug 11, 2025

Hey @DhruvTheDev1, thanks for working on the fix, and sorry for missing this earlier!

The animation examples should have been fixed now across all pages, and in versioned docs. Please let me know if there are still any issues, or just open a new report/PR, happy to review and ship it! For now, I'm closing this as done.

@Simek Simek closed this Aug 11, 2025
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.

3 participants