简体   繁体   English

我正在尝试在我的 React Native 应用程序中实现 Redux,因为教程使用 ReactDOM.render() 方法,但我似乎无法找到它,

[英]I am trying to implement Redux to my React Native app, as tutorials use ReactDOM.render() method, and I cannot seem to locate it,

As mentioned I am building a react-native app, and want to implement Redux, I am already deep into my project, using stack-navigator some api calls, aync storage and more.如前所述,我正在构建一个 react-native 应用程序,并且想要实现 Redux,我已经深入到我的项目中,使用堆栈导航器一些 api 调用、异步存储等。 However every tutorial I watch regarding redux, ends up manipulating the ReactDOM.render() method, typicall inside a index.js file.然而,我观看的每个关于 redux 的教程最终都会操作 ReactDOM.render() 方法,通常在 index.js 文件中。 However I cannot seem to find mine in my project, any help would be greatly appreciated.但是我似乎在我的项目中找不到我的,任何帮助将不胜感激。 Link to the repo:链接到回购:

https://github.com/mattyjjpearce/trackerApp/tree/filterFetchhttps://github.com/mattyjjpearce/trackerApp/tree/filterFetch

ps: latest version is the filterFetch branch ps:最新版本是filterFetch分支

Kindest Regards,最亲切的问候,

Matt马特

Create a new component under App.js and wrap the Navigator with a ProviderApp.js下新建一个组件,并用Provider包装Navigator

const App = createAppContainer(Navigator);
export default () => (<Provider store={store}><App/></Provider>)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM