nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

Missing web/index.html limits some web functionality #249

Closed guplem closed 2 years ago

guplem commented 2 years ago

Hi! I am creating an app/webpage which must include a MapView.

I was following the instructions shared by Expo (I am aware of the experimental state of the web support, but I wanted to give it a try anyway).

However, I can't find the web/index.html file, neither a starting point with HTML code where I could include the script for the API call configuration. Where should that code go instead? Is it even possible to use this code with Solito's architecture? (I am new with Solito I am not familiarized yet with how exactly it works)

I have started the project using the Tailwind CSS Starter.

Thanks!

nandorojo commented 2 years ago

Hey, we don’t use Expo Web with Solito. Instead, we use Next.js as the web entry point inside of apps/next. If you need to load in a script on Web, you can probably use next/script inside of pages/_app.tsx of the next app. I suggest getting familiar with how Next.js works, since Solito is just a way to pair Next with Expo.

guplem commented 2 years ago

@nandorojo Thanks for the prompt response! I will learn more about Next. However, this arose some questions: does this mean that there will be packages (native or expo) that won't work on the web? I would assume all packages marked with “web” compatibility should work without issues. I understood that Next was basically a wrap used to enable a native navigation experience (and some other improvements), but anything that works in Expo web should work as well with Solito?

nandorojo commented 2 years ago

If it supports React Native Web (and thus Expo Web), it should work with Next.js. Often times, RN libraries need to be added to next-transpile-modules in next.config.js.