I am a bit late, but if you are using vite for react, make sure to modify your vite.config.js such as
vite.config.js
server:{ host: true }