我正在与styled-components在我的react-native项目上工作。我们正在使用react-native-navigation在应用程序内执行导航。所以问题是我怎样才能从这种应用程序中的样式组件实现主题模式? 的问题是,在风格组件我有我的包裹顶级组件在<ThemeProvider />
这样的条款进行主题化的想法:react-native-navigation主题与样式组件
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>
但随着反应本地导航我没有顶级别组件。它具有屏幕的想法,所以应用程序的入口看起来像这样:
registerScreens(); // this is where you register all of your app's screens
// start the app
Navigation.startSingleScreenApp({
screen: { ... },
drawer: { ... },
passProps: { ... },
...
});
谢谢你的回答。这绝对是选项,但这意味着我必须用这个HOC来包装所有的屏幕。我正在寻找一些解决方案,比如它是为Redux Provider制作的。有办法做到这一点。 (看[#1920](https://github.com/wix/react-native-navigation/issues/1920)) –