mrzachnugent / react-native-reusables

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind.
https://rnr-docs.vercel.app
MIT License
3.88k stars 157 forks source link

[ BUG ] edit & save web fast-refresh does not works #263

Open hasunpark opened 1 month ago

hasunpark commented 1 month ago

Describe the bug hi i think fast-refresh is broken, can you check this issue?

To Reproduce Steps to reproduce the behavior:

git clone <react-native-reusable>
cp -R react-native-reusable/apps/starter-base ./test
bun install 
bun expo start --web

Expected behavior i expected fast refresh web when i edit code and save

Platform (please complete the following information):

Additional context 3eb633de0a717f8828d2345a53db5028e8774081 fix(cli): bump to v0.1.2

this is my current cloned project's HEAD commit thanks.

can solve this problem? or is there any idea to let me dig in?

migueldv90 commented 4 weeks ago

I just encountered this problem when cloning the app.

It's an open issue in the Expo repo. There are two solutions to this problem.

  1. The first one is to import @expo/metro-runtime at the top of the index.js file. I confirm this solution and it works.

`import '@expo/metro-runtime';

import { registerRootComponent } from 'expo'; import { ExpoRoot } from 'expo-router';

export function App() { const ctx = require.context('./app'); return ; }

registerRootComponent(App); `

  1. The second solution is to replace "main": "index.js" in package.json with "main": "expo-router/entry." I also confirmed this solution, and it works.

I will use "expo-router/entry" since it's the main way of working with expo-router.

hasunpark commented 3 weeks ago

@migueldv90 hi! thanks for solution! i'll try it and close if it solves. thanks for saving my time