pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.62k stars 1.6k forks source link

Incompatibility with Create React Native App (CRA) without Expo #3364

Open richardReitz opened 1 month ago

richardReitz commented 1 month ago

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.
DennisSmolek commented 1 month ago

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

CodyJasonBennett commented 1 month ago

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.