juliangarnier/anime

[FEATURE] Support for react-native

Open

#1 017 ouverte le 10 juin 2025

Voir sur GitHub
 (4 commentaires) (1 réaction) (1 assigné)JavaScript (4 580 forks)batch import
enhancementfeature proposalhelp wanted

Métriques du dépôt

Stars
 (68 158 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur