我将反应本机整合到现有的应用程序中。我正在将自己的原生页面作为独立应用程序单独开发。是否有可能从默认道具作为arg从命令行运行反应本机应用程序?
在我现有的遗留应用程序,我叫
RCTRootView(bridge: bridge, moduleName: "AnAlert", initialProperties: someProperties)
哪里someProperties是[String: Any]
类型的词典,它的JSON表示可能类似于这样的:
{"title": "Alert title", "body": "Alert body"}
我想设计独立于我的主应用程序的反应原生页面,但问题是我需要这些初始属性来完全配置页面。
有谁知道是否有可能运行react-native run-ios <option>
,其中<option>
是一个参数,被解释为默认props
?
当我运行react-native run-ios --help
时,我看到了其他选项,但没有一个可以描述我想要做什么。
-h, --help output usage information --simulator [string] Explicitly set simulator to use --configuration [string] Explicitly set the scheme configuration to use --scheme [string] Explicitly set Xcode scheme to use --project-path [string] Path relative to project root where the Xcode project (.xcodeproj) lives. The default is 'ios'. --device [string] Explicitly set device to use by name. The value is not required if you have a single device connected. --udid [string] Explicitly set device to use by udid --no-packager Do not launch packager while building --config [string] Path to the CLI configuration file
谢谢!