I'm new to React Native (but not React) and I wanted to follow the guide in the documentation : https://reactnative.dev/docs/environment-setup
The create-expo-app is working just fine, but when I try to start the App, everything seems fine in the console except ExpoGo App is showing "Something went wrong. Network response timed out" when I scan the QR Code. Same when I type the URL manually.
Do you know where this can come from ?
I'm on Windows but I'm using the Ubuntu terminal (WSL), and both my devices are on the same Wi-Fi.
When I was setting up my RN dev environment using Windows to house Android Studio for my emulators but keeping all my code on WSL2, I had a rough time getting everything setup as well. It sounds like you most likely don't have your port 8081 forwarded from WSL2 to Windows.
I use the command line (Admin Powershell) to do the Windows side of things.
Your Virtual Device should startup
Open a new terminal window and start the ADB server
This should be all you need to do extra to get your RN project talking between WSL and Windows.
A guide that I found very helpful for working through networking issues during my setup can be found here.
Also, if you are behind a proxy, there are several points throughout the setup where you will need to add your proxy information so you can reach the outside. So that's another networking piece to consider.
It may not be the perfect solution for everyone depending on our exact setup, but this is what I was able to use to get myself and other coworkers with working dev environments with Windows & WSL2.
Hope this helps.
UPDATE: One thing I failed to consider in my original post is that you are testing on physical devices. Depending on your exact setup, you may need to expose additional ports and install additional libraries on WSL2.