I created a basic react-native app with p5js canvas and while it works fine on web, it fails on mobile:
ReferenceError: Can't find variable: document
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
I tried using react-p5-wrapper, react-p5 and just p5 with no adapters and I have this issue even if I don't use any this libs but only import them.
Here is the repository with a sample