juliangarnier/anime

[FEATURE] Support for react-native

Open

#1017 aperta il 10 giu 2025

Vedi su GitHub
 (4 commenti) (1 reazione) (1 assegnatario)JavaScript (4580 fork)batch import
enhancementfeature proposalhelp wanted

Metriche repository

Star
 (68.158 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Describe the bug

I would like to use this library to make animations with Three.js using react-native with Expo.dev

Provide a minimal reproduction demo of the bug

import { registerRootComponent } from 'expo'
import React from 'react'
import { View, Text, Platform } from 'react-native'
import { animate } from 'animejs'

export default function App({}) {
    return (
        <View>
            <Text>{Platform.OS}</Text>
        </View>
    )
}

registerRootComponent(App)

Error

[runtime not ready]: ReferenceError: Property 'document' doesn't exist, js engine: hermes

anonymous
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:46467:24
loadModuleImplementation
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:253:13
guardedLoadModule
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:162:37
metroRequire
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:82:91
anonymous
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:3849:24
loadModuleImplementation
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:253:13
guardedLoadModule
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:155:46
metroRequire
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:82:91
global
    &platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=1&transform.routerRoot=app&unstable_transformProfile=hermes-stable:190717:3

And if possible, add a screen recording of the bug in action to help explain your problem.

Describe the expected behavior

As soon as I comment the line to import animejs everything works perfectly.

Guida contributor