resources

How to use Babylon.js inside React Native


Table of contents

Babylon.js inside React Native.

The Possibilities

Using 'webview' it is possible to run the Babylon.js Engine inside React Native on Windows and iOS with Android still under test.

However currently there are difficulties, especially on Windows, but with determination it is possible. Some issues are:

  • Debugging with webview can be very problematic however logging is possible.
  • Performance inside the webview is acceptable on Windows but it can be improved on iOS with a small twist
  • To load models you need to serve your files through a web server
  • The babylon RN “engine” is basically a website
  • Some packages for RN are custom and not yet merged inside their respective repos, so you need care with package.json
  • Getting it to work on React Native Windows is an art form at times

The experiment that provided the proof of concept and details of how to do it are in the Cubeslam Blog so to give it a go give it a read.