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

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



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1