reactjs - How to make React app preview on mobile? -
i noob using create-react-app
create app, yarn start
start server @ http://localhost:3000/
, can't visit url on mobile. how can make configs preview app on mobile?
first, remember can open mobile view in desktop browser (at least in chrome , firefox). see the article more. isn't substitute of testing on real mobile device can identify more obvious issues.
second, need use ip address of computer in local network (assuming mobile device on same network desktop). on linux , mac can check ip ipconfig
. localhost
refers current machine, i.e. localhost
on desktop points desktop , on mobile device points mobile device. that's why can't access - app runs on desktop not mobile.
once know ip address of computer need replace localhost
it. in case ip 192.168.1.10 use following address access app:
http://192.168.1.10:3000/
Comments
Post a Comment