3

Could anyone give some general guidance or point to an example of how to port a JavaScript library into a React Native component?

Specifically, I am interested in building a React Native component wrapper for AR.js, but I have no idea how to go about converting their system (which uses HTML<a-scene> elements) into something I could use as React Native markup.

Piotr Adam Milewski
  • 14,150
  • 3
  • 21
  • 42
Eric
  • 2,098
  • 4
  • 30
  • 44
  • Not very familiar with react native, I just use plain react... but the process for making components should be pretty much the same I imagine. If your 'scenes' are going to be pretty similar with only a few properties changing and such, it;d be pretty easy to make your component, but otherwise I'd recommend just going with a prebuilt binding for AR.js, like [this](https://www.npmjs.com/package/react-native-arkit) – Poootaatoooo Aug 15 '17 at 18:27

1 Answers1

3

You cannot port AR.js into React-native without writing a binding
Learn more here Bridging in React-native

But still there is a dummy option: use WebView and feed with html files (test it by opening AR.js demo on Safari of iOS first)

Medet Tleukabiluly
  • 11,662
  • 3
  • 34
  • 69