juliangarnier/anime

[FEATURE] Support for react-native

Open

#1,017 opened on Jun 10, 2025

View on GitHub
 (4 comments) (1 reaction) (1 assignee)JavaScript (4,580 forks)batch import
enhancementfeature proposalhelp wanted

Repository metrics

Stars
 (68,158 stars)
PR merge metrics
 (No merged PRs in 30d)

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.

Contributor guide