React native 使用web浏览器对React本机应用程序使用本地测试服务器?(npm包反应本机浏览器)

React native 使用web浏览器对React本机应用程序使用本地测试服务器?(npm包反应本机浏览器),react-native,react-native-ios,react-native-web,React Native,React Native Ios,React Native Web,我正在尝试运行一个本地测试服务器来测试对我的应用程序用html编写的视图的调整。我正在使用包react本机浏览器 项目名称为Bowser,以尽量减少混淆 作为Browser.open()的第一个参数的字符串的“localhost:3000”和“”都不起作用 正确的实施方式是什么?我是否打算使用react native http来实现此功能 var Browser = require('react-native-browser'); export default class Bow

我正在尝试运行一个本地测试服务器来测试对我的应用程序用html编写的视图的调整。我正在使用包react本机浏览器

项目名称为Bowser,以尽量减少混淆

作为Browser.open()的第一个参数的字符串的“localhost:3000”和“”都不起作用

正确的实施方式是什么?我是否打算使用react native http来实现此功能

    var Browser = require('react-native-browser');
    export default class Bowser extends Component {
        render() {
            //also tried https://localhost:3000
            Browser.open('localhost:3000', {
                showUrlWhileLoading: false
                , navigationButtonsHidden: true
                , showActionButton: false
                , showDoneButton: false
                , showPageTitles: false
                , disableContextualPopupMenu: false
                , hideWebViewBoundaries: true
            });
            return ( < View style = {
                    styles.container
                } > < Text style = {
                    styles.welcome
                } > Welcome to React Native! < /Text> < Text style = {
                    styles.instructions
                } > To get started, edit index.ios.js < /Text> < Text style = {
                    styles.instructions
                } > Press Cmd + R to reload, {
                    '\n'
                }
                Cmd + D or shake
                for dev menu < /Text> < /View>);
        }
    }
var-Browser=require('react-native-Browser');
导出默认类Bowser扩展组件{
render(){
//也试过https://localhost:3000
Browser.open('localhost:3000'{
加载时显示:false
,导航按钮隐藏:true
,showActionButton:false
,showDoneButton:false
,showPageTitles:false
,DisableContextalPoupMenu:false
,hideWebViewBoundaries:对
});
返回(<视图样式={
样式.容器
}><文本样式={
欢迎光临
}>欢迎使用React Native!要开始,请编辑index.ios.js按Cmd+R重新加载{
“\n”
}
Cmd+D或shake
对于开发菜单);
}
}

您是否尝试使用React Native的内置WebView组件?而且,您的模拟器可能无法通过本地主机连接,获取计算机的本地IP,然后尝试使用它。@EnieJakiro我对R-N非常陌生。谢谢您的建议!我将让他们尝试使用mac终端中的(ifconfig | grep inet)或windows cmd中的(ipconfig/ALL)查找计算机的IP地址。其中一个应该用作WebView uri:exhttp://194.178.1.2:4242/my-局部端点