官术网_书友最值得收藏!

  • React Native Blueprints
  • Emilio Rodriguez Martinez
  • 255字
  • 2021-07-02 15:20:01

Setting up the folder structure

As we did in the first chapter, we need to initialize a new React Native project through React Native's CLI. This time, we will name our project RSSReader:

react-native init --version="0.49.3" RSSReader

For this app, we will need a total of four screens:

  • FeedList: This is a list containing the titles for the feeds which were added to the app sorted by the time they were added.
  • AddFeed: This is a simple form to allow the user to add a feed by sending its URL. We will here retrieve the feed details to finally add and save them in our app for later usage.
  • FeedDetail: This is a list containing the latest entries (retrieved before mounting the screen) belonging to the selected feed.
  • EntryDetail: This is a WebView showing the contents of the selected entry.

Besides the screens, we will include an actions.js file containing all the user actions modifying the app's state. Although we will review how the state is managed in a later section, in detail, it's also important to note that besides this actions.js file, we need a store.js file to contain the state structure and methods to modify it.

Finally, and as it is normal in most of the React Native projects, we will need an index.js  file (already created by React Native's CLI) and a main.js file to serve as an entry point for our app's components tree.

All these files will be organized inside src/ and src/screens/ folders, as follows:

主站蜘蛛池模板: 金川县| 苗栗市| 金昌市| 英德市| 河津市| 罗田县| 灵武市| 偃师市| 苍梧县| 平原县| 漯河市| 仲巴县| 道真| 银川市| 志丹县| 龙陵县| 南岸区| 扶沟县| 龙岩市| 临安市| 霍州市| 临夏县| 华阴市| 泸定县| 清远市| 常山县| 丁青县| 普定县| 广德县| 六盘水市| 清新县| 阜宁县| 永登县| 南澳县| 哈巴河县| 德清县| 张北县| 甘泉县| 汾阳市| 湘乡市| 吴忠市|