P5.js in React Native

Has anyone successfully got p5.js (instanced mode) working in React Native?

I’ve stumbled across this which works, however it’s using processing.js rather than p5.

The main issue I’m struggling with is p5’s browser/window/global dependencies, however can’t find any examples/polyfills online.

Ru actually using that expo library?

If so, either stick w/ Pjs or request them to create a hackish wrapper for p5js too.
You know, Pjs has an API similar to p5js’: GitHub - processing-js/processing-js: A port of the Processing visualization language to JavaScript.

Now, if you don’t mind that expo library, and just wanna use p5js + React only, you can search for other wrappers for it.
Or you can ask us to help you make your own hack to embed p5js w/ React.

I dunno React yet, and got no idea how it works. :confused:

But I’ve got this p5js sketch which relies on ES6 native modules: :angel:

B/c p5js isn’t itself a module, I had to create a simple “.js” file to act as a bridge between the modular sketch I’ve written and the p5js library instantiation: :bridge_at_night:

I believe the technique above can be used for import() a React.Component subclass which contains our sketch function inside of it, similar to the expo example from your link: :bulb: