DEV Community

Discussion on: Tutorial: How to share code between iOS, Android & Web using React Native, react-native-web and monorepo

Collapse
 
5ervant profile image
Mark Anthony B. Dungo

Hello Bruno,

1.) Now that Expo for Web was released, what would you recommend?
To setup a monorepo for Mobile and Web packages or to use Expo for Web?
There's also a React Native Web CLI called create-react-native-web-app.

2.) And also could you give some guide how to setup Next.js as a package of this monorepo? Upon running yarn create next-app --example with-react-native-web next, here's the response:

PS C:\Users\USERNAME\Documents\Node.js Projects\Samples\myprojectname\packages> yarn create next-app --example with-react-native-web next
yarn create v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app@0.5.9" with binaries:
      - create-next-app
- Downloading files for with-react-native-web example[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4
DEPRECATED (@octokit/rest): `repos.getContent()` is deprecated, use `repos.getContents()`
> Success! Downloaded with-react-native-web files for next

  Installing npm modules:
    react
    react-dom
    next

> Error! Failed to install react, react-dom, next, try again.
undefined
(node:12428) UnhandledPromiseRejectionWarning: Error: yarn installation failed
    at C:\Users\USERNAME\AppData\Local\Yarn\Data\global\node_modules\create-next-app\lib\utils\install.js:39:23
    at processTicksAndRejections (internal/process/task_queues.js:82:5)
(node:12428) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:12428) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are
not handled will terminate the Node.js process with a non-zero exit code.
Done in 17.47s.

Thanks for any response!

Collapse
 
brunolemos profile image
Bruno Lemos

Expo has it's own set of limitations, e.g. I've been using hooks in production since november 2018 and it only arrived in expo may 2019. If you are ok using expo go for it! They seem to be doing great progress.

About next, I don't know what the issue is, try creating the project separately and copy pasting the folder into the monorepo. Otherwise open an issue with them about monorepo support.