Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Fix incorrect useAnimatedValue usage in Animated documentation

Chiusa Adatta ai principianti
#5,263 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Simek ci sta già lavorando.

Dal 6/10/2026.

  • #5264 di @Simek — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
85/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react-native
Ambito
documentation

Direzione di ricerca

Individua la pagina della documentazione dell’API Animated nel repository react-native-website, trova l’esempio di codice che importa e usa erroneamente useAnimatedValue, sostituisci useAnimatedValue(0) con new Animated.Value(0) e rimuovi l’importazione inutilizzata di useAnimatedValue, quindi verifica che l’esempio venga eseguito senza l’errore di runtime segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

The Animated documentation currently contains an incorrect code example that imports and uses useAnimatedValue from react-native.

The example fails at runtime because useAnimatedValue is not available from react-native in the version used by the documentation.

This PR fixes the example by replacing useAnimatedValue(0) with new Animated.Value(0) and removing useAnimatedValue from the imports.

What is the problem?

The example in the Animated documentation imports useAnimatedValue from react-native and uses it to initialize the animated value.

This results in a runtime error because useAnimatedValue is not available from react-native:

TypeError: (0, _reactNative.useAnimatedValue) is not a function

As a result, users following the official documentation are unable to run the example as provided.

How can we address it?

Replace useAnimatedValue(0) with new Animated.Value(0) and remove useAnimatedValue from the react-native imports.

No other changes to the example are required.

Why is it important?

The example is part of the official React Native documentation, so users may reasonably expect the code to work when copied directly into a project.

A runtime error in a basic Animated example can be particularly confusing for developers learning or getting started with React Native.

Who needs this?

This is relevant to developers using the React Native Animated API, especially developers learning React Native or following the official documentation examples.

When should this happen (use version numbers if needed)?

This should be fixed as soon as possible so that the Animated documentation provides a working example.

https://github.com/react/react-native-website/pull/5122

Lingua principale
MDX
Stelle
2.2k
Fork
6.4k
Merge medio
13h 6m
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di react/react-native-website

Tutte le issue di react/react-native-website

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.