pmndrs/react-three-fiber

Incompatibility with Create React Native App (CRA) without Expo

Opened this issue · 2 comments

Hello,

I am facing an issue when trying to use @react-three/fiber in a React Native project created without Expo (using Create React Native App, CRA). The library seems to have a dependency on Expo-specific packages like expo-gl, which makes it difficult to use in a non-Expo environment.

Steps to Reproduce

  1. Create a new React Native project using npx react-native init MyApp.
  2. Install @react-three/fiber using yarn add @react-three/fiber three.
  3. Attempt to use the library in the project.

Is there a comparable package to expo-gl that lets you use webgl inside a react-native project?

The library seems to have a dependency on Expo-specific packages like expo-gl, which makes it difficult to use in a non-Expo environment.

What is the expectation here? Have you tried https://r3f.docs.pmnd.rs/getting-started/installation#react-native? Difficulty is not really actionable.

Is there a comparable package to expo-gl that lets you use webgl inside a react-native project?

No, but I have registered react-native-angle for future work on this. It's possible to fork expo-gl and drop expo and deprecated AR features; just that is still tied to OpenGL and will grow divergent with browsers. There's not a maintained Node.js port either.