Is there a way to use p5.js in a react native app?

Viewed 1070

Is there a way to use p5.js in a react native app? Found an old post from 2017 that said it was not possible. But many things changed on both front since then and i am new go this. Any guidance would be helpful

1 Answers

In addition to the comments with very useful repositories/libraries, you may want to know this:

  • p5.js could need the window object to be initialised. Not compatible with Server Side Rendering (SSR), for example.
  • You can still import p5.js lazily (see import(...) syntax for example) once the page is loaded on the client's side, and pass it a canvas as a ref, but this will require some async logic, which is not always a breeze in React.
Related