<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>React Native Elements Blog</title>
        <link>https://reactnativeelements.com/blog</link>
        <description>React Native Elements Blog</description>
        <lastBuildDate>Sun, 15 May 2022 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[React Native Elements 4.0]]></title>
            <link>https://reactnativeelements.com/blog/2022/05/15/rneui-migration-guide</link>
            <guid>https://reactnativeelements.com/blog/2022/05/15/rneui-migration-guide</guid>
            <pubDate>Sun, 15 May 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[React Native Elements v4 introduces many features including few new components, fully typescript support and some breaking changes whose migration is being given below.]]></description>
            <content:encoded><![CDATA[<div align="center"><img loading="lazy" src="/img/website/seo.png" class="img_ev3q"></div><div class="admonition admonition-info alert alert--info"><div class="admonition-content">React Native Elements v4 introduces many features including few new components, fully typescript support and some breaking changes whose migration is being given below.</div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="migration-guide">Migration Guide<a href="#migration-guide" class="hash-link" aria-label="Direct link to Migration Guide" title="Direct link to Migration Guide">​</a></h2><p>Refer the <a href="/migration/migration-v3">migration guide</a> to migrate from v3 to v4.</p>]]></content:encoded>
            <author>arpitbhallay@proton.me (Arpit Bhalla)</author>
        </item>
        <item>
            <title><![CDATA[Google Summer of Code'21 Arpit Bhalla]]></title>
            <link>https://reactnativeelements.com/blog/2021/08/23/google-summer-of-code-arpitBhalla</link>
            <guid>https://reactnativeelements.com/blog/2021/08/23/google-summer-of-code-arpitBhalla</guid>
            <pubDate>Mon, 23 Aug 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[📑 Project Details]]></description>
            <content:encoded><![CDATA[<div align="center"><img loading="lazy" src="https://raw.githubusercontent.com/arpitBhalla/google-summer-of-code/master/assets//header.png" class="img_ev3q"></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-project-details">📑 Project Details<a href="#-project-details" class="hash-link" aria-label="Direct link to 📑 Project Details" title="Direct link to 📑 Project Details">​</a></h2><ul><li><p>Organization: <a href="https://github.com/react-native-elements" target="_blank" rel="noopener noreferrer">React Native Elements</a></p></li><li><p>Project: <a href="https://summerofcode.withgoogle.com/projects/#5514659471294464" target="_blank" rel="noopener noreferrer">Migrating Hooks, Tests &amp; APIs</a></p></li><li><p>Mentors: <a href="https://github.com/flyingcircle" target="_blank" rel="noopener noreferrer">Jeremy Hamilton</a>, <a href="https://github.com/pranshuchittora" target="_blank" rel="noopener noreferrer">Pranshu Chittora</a>, <a href="https://github.com/dhruvdutt" target="_blank" rel="noopener noreferrer">Dhruvdutt</a></p></li><li><p>Student: <a href="https://github.com/arpitBhalla" target="_blank" rel="noopener noreferrer">Arpit Bhalla</a></p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-overview">🚀 Overview<a href="#-overview" class="hash-link" aria-label="Direct link to 🚀 Overview" title="Direct link to 🚀 Overview">​</a></h2><p>The <strong>Google Summer of Code 2021</strong> has been a fantastic and cheerful learning experience for me over the past few months. I have learned a lot from the community, especially how to organize commits and write readable code. <strong>React Native Elements</strong> is an amazing community to work with, as mentors are really helpful and experienced. I had started contributing to React Native Elements from March 2021 and till now, I have 40+ commits (10,803 additions and 13,826 deletions) merged. Over the past few months, I had great exposure writing maintainable code, communicating with the mentors, etc. I had completed some of my work in the coding period started as some issues mentioned in my proposal had a high priority for the release.</p><div align="center"><img loading="lazy" src="https://raw.githubusercontent.com/arpitBhalla/google-summer-of-code/master/assets//contri.png" width="900" class="img_ev3q"></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-work-abstract">🚘 Work Abstract<a href="#-work-abstract" class="hash-link" aria-label="Direct link to 🚘 Work Abstract" title="Direct link to 🚘 Work Abstract">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="refactor-components-to-use-pressable-api-3170">Refactor components to use <code>Pressable</code> API <a href="https://github.com/react-native-elements/react-native-elements/pull/3170" target="_blank" rel="noopener noreferrer">(#3170)</a><a href="#refactor-components-to-use-pressable-api-3170" class="hash-link" aria-label="Direct link to refactor-components-to-use-pressable-api-3170" title="Direct link to refactor-components-to-use-pressable-api-3170">​</a></h3><blockquote><p><code>Pressable</code> is preferred to <code>Touchable</code> components according to React Native official docs. <code>Pressable</code> component offers a more extensive and future-proof way of handling the touch-based inputs.</p></blockquote><ul><li><p><code>Touchable</code> Component:</p><ul><li>It includes the styles and effects that do not meet the platform interactions.</li><li>It does not support high-quality interaction experience on different platforms.</li></ul></li><li><p><code>Pressable</code> Component:</p><ul><li>It detects various types of interactions.</li><li>Its API provides direct access to the current state of interaction.</li><li>Its capabilities could be extended to include hover, blur, focus, and more.
<code>Pressable</code> contains a lot of new props and cool features such as:
delayLongPress: Duration in milliseconds from onPressIn by the time onLongPress is called.</li></ul></li></ul><p>Reference : <a href="https://medium.com/@mahyarmohammadi/react-native-pressable-vs-touchable-5fec6b332f15" target="_blank" rel="noopener noreferrer">Pressable vs. Touchable in React Native</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="migrate-tests-to-react-native-testing-library-3170">Migrate Tests to React Native Testing Library <a href="https://github.com/react-native-elements/react-native-elements/pull/3170" target="_blank" rel="noopener noreferrer">(#3170)</a><a href="#migrate-tests-to-react-native-testing-library-3170" class="hash-link" aria-label="Direct link to migrate-tests-to-react-native-testing-library-3170" title="Direct link to migrate-tests-to-react-native-testing-library-3170">​</a></h3><blockquote><p>Rather than tests focusing on the implementation (Enzyme), tests are more focused on user behavior (react-native-testing-library).</p></blockquote><p>Enzyme allows us to access the internal workings of your components. You can read and set the state, and we can mock children to make tests run faster. On the other hand, RN testing-library doesn't give us any access to the implementation details. It renders the components and provides utility methods to interact with them. The idea is that you should communicate with our application in the same way a user would. So rather than set the state of a component we reproduce the actions a user would do to reach that state.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="class-to-functions-migration">Class to Functions Migration<a href="#class-to-functions-migration" class="hash-link" aria-label="Direct link to Class to Functions Migration" title="Direct link to Class to Functions Migration">​</a></h3><p>Some components like <strong>Image, ToolTip</strong> which further include SearchBar android &amp; SearchBar iOS were Class Components and the code was messy, These are migrated to Functional Components and added hooks like, useState, useEffect, useCallBack, which would increase performance.</p><ul><li><strong>Using classes</strong> - We need to describe lifecycle methods, state of the component, component’s methods that will change our state or work with the store. Also, we need to bind all the methods for the component instance. The component becomes large, and it becomes more difficult to read each time.</li><li><strong>Using hooks</strong> - We can get the state of the component so that it can be easily tested and reused. Now we can facilitate the exchange of links between components or our entire application - using hooks. Hooks allow you to encapsulate logic without affecting the hierarchy of components.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-my-contributions">🎊 My Contributions<a href="#-my-contributions" class="hash-link" aria-label="Direct link to 🎊 My Contributions" title="Direct link to 🎊 My Contributions">​</a></h2><p>You can find all my contributions <a href="https://github.com/react-native-elements/react-native-elements/pulls?q=is%3Apr+author%3AarpitBhalla+sort%3Aupdated-desc+is%3Amerged" target="_blank" rel="noopener noreferrer">here</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="new-components">New components<a href="#new-components" class="hash-link" aria-label="Direct link to New components" title="Direct link to New components">​</a></h3><ul><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2867" target="_blank" rel="noopener noreferrer">LinearProgress (#2867)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2885" target="_blank" rel="noopener noreferrer">FAB (#2885)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2896" target="_blank" rel="noopener noreferrer">Speed dial (#2896)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2919" target="_blank" rel="noopener noreferrer">Tab &amp; TabItem (#2919)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements-universe/pull/1" target="_blank" rel="noopener noreferrer">CircularSlider (#1)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2983" target="_blank" rel="noopener noreferrer">TabView &amp; TabView.Item (#2983)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2953" target="_blank" rel="noopener noreferrer">ListItem Accordion (#2953)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2982" target="_blank" rel="noopener noreferrer">ListItem Swipeable (#2982)</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="core-improvements">Core Improvements<a href="#core-improvements" class="hash-link" aria-label="Direct link to Core Improvements" title="Direct link to Core Improvements">​</a></h3><ul><li><a href="https://github.com/react-native-elements/react-native-elements/pull/3101" target="_blank" rel="noopener noreferrer">Migrate build to Github Actions (#3101)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2930" target="_blank" rel="noopener noreferrer">Strict TypeScript (#2930)</a></li><li><a href="https://github.com/react-native-elements/react-native-elements/pull/2834" target="_blank" rel="noopener noreferrer">Removed ts-ignore and transformed to Functional Component (#2834)</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="documentation-redesigned-3108">Documentation redesigned <a href="https://github.com/react-native-elements/react-native-elements/pull/3108" target="_blank" rel="noopener noreferrer">(#3108)</a><a href="#documentation-redesigned-3108" class="hash-link" aria-label="Direct link to documentation-redesigned-3108" title="Direct link to documentation-redesigned-3108">​</a></h3><div align="center"><img loading="lazy" src="https://raw.githubusercontent.com/arpitBhalla/google-summer-of-code/master/assets//website.png" class="img_ev3q"></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="snack-player">Snack player<a href="#snack-player" class="hash-link" aria-label="Direct link to Snack player" title="Direct link to Snack player">​</a></h3><p>It helps user to test the component from documentation</p><div align="center"><img loading="lazy" src="https://raw.githubusercontent.com/arpitBhalla/google-summer-of-code/master/assets//snack.png" class="img_ev3q"></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="vs-code-extension">VS Code extension<a href="#vs-code-extension" class="hash-link" aria-label="Direct link to VS Code extension" title="Direct link to VS Code extension">​</a></h3><p>Auto imports components and auto complete syntax with component preview for React Native Elements.</p><div align="center"><img loading="lazy" src="https://raw.githubusercontent.com/arpitBhalla/google-summer-of-code/master/assets//vscode.png" class="img_ev3q"></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-whats-next">🚧 What's next?<a href="#-whats-next" class="hash-link" aria-label="Direct link to 🚧 What's next?" title="Direct link to 🚧 What's next?">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="new-stack-component">New <code>Stack</code> Component<a href="#new-stack-component" class="hash-link" aria-label="Direct link to new-stack-component" title="Direct link to new-stack-component">​</a></h3><p>Stack is concerned with one-dimensional layouts. <code>This is not yet in the priority</code> but it would help developers.</p><p>Example</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Stack</span><span class="token plain"> spacing</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token number" style="color:#36acaa">2</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Item</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token maybe-class-name">Item</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Item</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Item</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token maybe-class-name">Item</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">2</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Item</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Item</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token maybe-class-name">Item</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">3</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Item</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Stack</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>]]></content:encoded>
            <author>arpitbhallay@proton.me (Arpit Bhalla)</author>
        </item>
        <item>
            <title><![CDATA[Google Summer of Code'21 Khushal Agarwal]]></title>
            <link>https://reactnativeelements.com/blog/2021/08/18/google-summer-of-code-khushal-agarwal</link>
            <guid>https://reactnativeelements.com/blog/2021/08/18/google-summer-of-code-khushal-agarwal</guid>
            <pubDate>Wed, 18 Aug 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[Automatically generate documentation out of React/React Native Component]]></description>
            <content:encoded><![CDATA[<div align="center"><a href="https://summerofcode.withgoogle.com/projects/#5690075263795200" target="_blank" rel="noopener noreferrer"><img loading="lazy" src="https://pbs.twimg.com/media/EwIc141UUAUnA7x.png" width="650" alt="google-summer-of-code" class="img_ev3q"></a><br><b><p>Automatically generate documentation out of React/React Native Component</p></b></div><p>This summer, I was pleased to get selected for Google Summer of Code'21 under the organization <a href="https://github.com/react-native-elements" target="_blank" rel="noopener noreferrer">React Native Elements</a>. Working under the organization, my project was to <strong>generate documentation automatically out of the UI components and present it in the Docusaurus website</strong>.</p><div align="center"><p><img loading="lazy" src="https://media.giphy.com/media/ZcKASxMYMKA9SQnhIl/giphy.gif" alt="enter image description here" class="img_ev3q"></p></div><p>The purpose of creating this repository is to maintain a report summary of my GSoC work and this may also serve as a guide for future GSoC aspirants and a reference to the developers and contributors to the project.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-abstract">📙 Abstract<a href="#-abstract" class="hash-link" aria-label="Direct link to 📙 Abstract" title="Direct link to 📙 Abstract">​</a></h2><p><a href="https://www.npmjs.com/package/react-native-elements" target="_blank" rel="noopener noreferrer">React Native Elements</a> is a cross-platform UI toolkit built on/for React Native. With a weekly download by 90k+ users and backed by a huge community, it provides UI components that can be used in your native application for the platform of Android/iOS/Web.</p><p>The documentation of the project was maintained manually previously i.e., suppose I want to change/add/remove a prop or a new component to the project the markdown file had to be changed manually. The process is tiring and new contributors may often forget to do so. So, during the summers I took the change this process and make a workflow such that the generation is automatic. This should be <strong>fast and maintainable</strong>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-deliverables">📝 Deliverables<a href="#-deliverables" class="hash-link" aria-label="Direct link to 📝 Deliverables" title="Direct link to 📝 Deliverables">​</a></h2><p>The deliverables of the project are as follows:</p><ul class="contains-task-list containsTaskList_mC6p"><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Efficient Development Setup</li><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Re-structure and Refactor code to have a common pattern.</li><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Maintain the Usage/Examples of the component as they are needed to be updated manually.</li><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Refactor and rename the directory structure such that Autogen is successful.<ul><li>Convert the code-base to have all the functional components.</li></ul></li><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Commenting on all the components and props.<ul><li>Adding descriptions.</li><li>Adding prop descriptions.</li><li>Ensuring a common pattern is followed.</li></ul></li><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Writing <strong>scripts to extract data out</strong>(in JS/TS) of it in the form of JSON.</li><li class="task-list-item"><input type="checkbox" checked="" disabled=""> <!-- -->Converting the JSON data to Markdown.</li><li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->Automating the process such that the workflow works automatically whenever there is a change in the prop/definition or component code.</li></ul><p>All of the listed deliverables were completed within the GSoC period. 🎉</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-working-product">📦 Working product<a href="#-working-product" class="hash-link" aria-label="Direct link to 📦 Working product" title="Direct link to 📦 Working product">​</a></h2><p>The work can be found here - <a href="https://reactnativeelements.com/docs/next/" target="_blank" rel="noopener noreferrer">Official Website of React native elements</a>. Please refer to the component docs.</p><p><strong>I have also written a blog on how it works attached <a href="https://deploy-preview-3145--react-native-elements.netlify.app/blog/2021/08/12/auto-generation-of-docs" target="_blank" rel="noopener noreferrer">here</a>.</strong></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-contributions">🚀 Contributions<a href="#-contributions" class="hash-link" aria-label="Direct link to 🚀 Contributions" title="Direct link to 🚀 Contributions">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="pull-requests">Pull requests<a href="#pull-requests" class="hash-link" aria-label="Direct link to Pull requests" title="Direct link to Pull requests">​</a></h3><table><thead><tr><th>PR Link</th><th>Description</th><th>Status</th></tr></thead><tbody><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3071" target="_blank" rel="noopener noreferrer">#3071</a></td><td>[Refactor]<!-- --> Documentation directory structure</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3081" target="_blank" rel="noopener noreferrer">#3081</a></td><td>[Refactor]<!-- --> Directory structure of components</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3112" target="_blank" rel="noopener noreferrer">#3112</a></td><td>[Add]<!-- --> props description, descriptions to the component.</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3126" target="_blank" rel="noopener noreferrer">#3126</a></td><td>[Docs]<!-- --> Added demos and snack for the documentation</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3136" target="_blank" rel="noopener noreferrer">#3136</a></td><td>[Add]<!-- --> Docgen auto generation of docs scripts</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3142" target="_blank" rel="noopener noreferrer">#3142</a></td><td>[Docs]<!-- --> Added generate-markdown scripts</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3143" target="_blank" rel="noopener noreferrer">#3143</a>, <a href="https://github.com/react-native-elements/react-native-elements/pull/3144" target="_blank" rel="noopener noreferrer">#3144</a></td><td>[Fix]<!-- --> Issues related to auto-generation of documentation</td><td>Merged ✅</td></tr><tr><td><a href="https://github.com/react-native-elements/react-native-elements/pull/3145" target="_blank" rel="noopener noreferrer">#3145</a></td><td>[Fix, Improve]<!-- --> Doc-gen issues and automation</td><td>Open(to be merged) 🕒</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="issues">Issues<a href="#issues" class="hash-link" aria-label="Direct link to Issues" title="Direct link to Issues">​</a></h3><table><thead><tr><th>Issue link</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://github.com/react-native-elements/react-native-elements/issues/3171" target="_blank" rel="noopener noreferrer">#3171</a></td><td>[Docs]<!-- --> Auto-generation of documentation for class based components</td></tr></tbody></table><p>Apart from these contributions, I have contributed to other React native elements projects. They can be summarized as:</p><ul><li><a href="https://github.com/pulls?q=is:pr+org:react-native-elements+author:khushal87" target="_blank" rel="noopener noreferrer">Pull requests</a></li><li><a href="https://github.com/issues?q=is:issue+org:react-native-elements+author:khushal87" target="_blank" rel="noopener noreferrer">Issues</a></li></ul><table><thead><tr><th>Project</th><th>Reference</th></tr></thead><tbody><tr><td>React Native Elements - main repo</td><td><a href="https://github.com/react-native-elements/react-native-elements/pulls?q=is%3Apr+author%3Akhushal87+" target="_blank" rel="noopener noreferrer">Pull requests</a></td></tr><tr><td>React Native Elements App</td><td><a href="https://github.com/react-native-elements/react-native-elements-app/pulls?q=is%3Apr+author%3Akhushal87+is%3Aclosed" target="_blank" rel="noopener noreferrer">Pull requests</a></td></tr><tr><td>Playground</td><td><a href="https://github.com/react-native-elements/playground/pulls?q=is%3Apr+author%3Akhushal87+is%3Aclosed" target="_blank" rel="noopener noreferrer">Pull requests</a></td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-mentors">👨 Mentors<a href="#-mentors" class="hash-link" aria-label="Direct link to 👨 Mentors" title="Direct link to 👨 Mentors">​</a></h2><p>I would like to thank my mentors for helping me reach this milestone. 😄😄</p><p>I have not only learned about the Open Source culture and how to write good code but also, learned how the industry works and the import</p><ul><li><strong>Dhruvdutt Jadhav</strong> - <a href="https://github.com/dhruvdutt" target="_blank" rel="noopener noreferrer">GitHub</a>. <a href="https://www.linkedin.com/in/dhruvdutt-jadhav/" target="_blank" rel="noopener noreferrer">LinkedIn</a></li><li><strong>Pranshu Chittora</strong> - <a href="https://github.com/pranshuchittora" target="_blank" rel="noopener noreferrer">GitHub</a>. <a href="https://www.linkedin.com/in/pranshuchittora/" target="_blank" rel="noopener noreferrer">LinkedIn</a></li><li><strong>Jeremy Hamilton</strong> - <a href="https://github.com/flyingcircle" target="_blank" rel="noopener noreferrer">GitHub</a>. <a href="https://www.linkedin.com/in/jeremy-hamilton-19b6217b/" target="_blank" rel="noopener noreferrer">LinkedIn</a></li></ul><p>I would also like to thank <a href="https://github.com/arpitBhalla" target="_blank" rel="noopener noreferrer">Arpit Bhalla</a> for being an amazing partner in this amazing journey.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-links">🔗 Links<a href="#-links" class="hash-link" aria-label="Direct link to 🔗 Links" title="Direct link to 🔗 Links">​</a></h2><div align="center"><table><thead><tr><th align="left"><strong>Student</strong></th><th align="center">Khushal Agarwal</th></tr></thead><tbody><tr><td align="left"><strong>Organization</strong></td><td align="center"><a href="https://github.com/react-native-elements/" target="_blank" rel="noopener noreferrer">React Native Elements</a></td></tr><tr><td align="left"><strong>Project</strong></td><td align="center"><a href="https://summerofcode.withgoogle.com/projects/#5690075263795200" target="_blank" rel="noopener noreferrer">Automatically generate documentation from components</a></td></tr><tr><td align="left"><strong>GitHub</strong></td><td align="center"><a href="https://github.com/khushal87" target="_blank" rel="noopener noreferrer">khushal87</a></td></tr><tr><td align="left"><strong>LinkedIn</strong></td><td align="center"><a href="https://www.linkedin.com/in/khushal87" target="_blank" rel="noopener noreferrer">Khushal Agarwal</a></td></tr><tr><td align="left"><strong>Twitter</strong></td><td align="center"><a href="https://www.twitter.com/khushal87" target="_blank" rel="noopener noreferrer">khushal87</a></td></tr><tr><td align="left"><strong>Email</strong></td><td align="center"><a href="mailto:khushal.agarwal987@gmail.com" target="_blank" rel="noopener noreferrer"></a><a href="mailto:khushal.agarwal987@gmail.com" target="_blank" rel="noopener noreferrer">khushal.agarwal987@gmail.com</a></td></tr></tbody></table></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auto-generation of Documentation Website]]></title>
            <link>https://reactnativeelements.com/blog/2021/08/12/auto-generation-of-docs</link>
            <guid>https://reactnativeelements.com/blog/2021/08/12/auto-generation-of-docs</guid>
            <pubDate>Thu, 12 Aug 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[This is a guide to generate documentation of the UI components automatically.]]></description>
            <content:encoded><![CDATA[<blockquote><p>This is a guide to generate documentation of the UI components automatically.</p></blockquote><p>Initially when this workflow was not present, the entire documentation of the website was done by editing the docs manually by going to the <code>docs</code> directory under <code>website</code> and editing the markdown manually. Now, we have come with a flow where developers and contributors can focus more on logic than on writing markdown.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="workflow">Workflow<a href="#workflow" class="hash-link" aria-label="Direct link to Workflow" title="Direct link to Workflow">​</a></h2><p>To do this we have created scripts which would parse the components and generate documentation out of it.</p><p>This is a 2 step process:</p><ol><li><p>We take use of <code>react-docgen-typescript</code> which takes the input of the files for which we want to generate the documentation automatically. This gives in JSON as output. This JSON consists of all the details of the props including <code>type</code>, <code>name</code>, <code>description</code> and <code>defaultValue</code> and well as <code>description</code> of the components.</p></li><li><p>As we use Docusaurus for our documentation website, the pages of the documentation should be in the format of Markdown. Therefore, there should be process where we can change the JSON data, which we get from <code>react-docgen-typescript</code> to a suitable Markdown format. For this we use, <code>json2md</code> which takes in the data and convert it to suitable markdown string. This is stored in the directory and is shown on the website.</p></li></ol><h4 class="anchor anchorWithStickyNavbar_LWe7" id="how-does-this-work">How does this work<a href="#how-does-this-work" class="hash-link" aria-label="Direct link to How does this work" title="Direct link to How does this work">​</a></h4><p>Well to make the script to work automatically what we have done is as follows:</p><ol><li><p>When you push your changes to your branch. A script <code>updateDocumentation.js</code> runs.</p></li><li><p>This invokes the <code>yarn docs-build</code> command which calls the scripts of auto-generation of docs and this also <em>lints</em> the markdown files generated at the same time.</p></li><li><p>Now, if there is any changes in the markdown files. A commit with message <code>Update Documentation</code> is done and pushed after your commit is done to the branch.</p></li></ol><p><strong>Note:</strong> By passing pre-push hook will result in failure of documentation update and may lead maintainers to close your PR.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="updating-existing-components">Updating existing components<a href="#updating-existing-components" class="hash-link" aria-label="Direct link to Updating existing components" title="Direct link to Updating existing components">​</a></h2><p>This is simple. Adding, removing, updating the props is also simple now. You just need to update the comments/description of the component and deal with the logic of your React Components(if required). Our workflow will automatically detect the markdown changes if any and push the changes using <code>pre-push</code> hooks while you push your code to your branch.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="adding-new-components">Adding new components<a href="#adding-new-components" class="hash-link" aria-label="Direct link to Adding new components" title="Direct link to Adding new components">​</a></h2><p>Trust me this is easy. We have designed the workflow such that, you only need to work on your JavaScript/TypeScript logic, without bothering about updating the markdown files. The input to the docgenParser is automatic and doesn't require any aditional cofiguration.</p><p><strong>Make sure to add appropriate comments and description related to the components and the props of the component. Try keeping your code simple with simpler types for Autogen to work.</strong></p><p><strong>Please note:</strong> The file name of the component as well as the folder must be in Capital letter. We use <code>regex</code> to parse the file paths, so this is important.</p><p><strong>Note</strong>: If there are complex types/defaultValue, please head to <code>website/scripts/docgen/docgenParser.ts</code> to deal with those cases. Although we recommend you to avoid it as far as possible. Try improving the React logic and that will work.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-add-a-new-demo-for-the-component">How to add a new demo for the component?<a href="#how-to-add-a-new-demo-for-the-component" class="hash-link" aria-label="Direct link to How to add a new demo for the component?" title="Direct link to How to add a new demo for the component?">​</a></h2><p>The demos can now be added by moving in to the <code>usage</code> directory under <code>website/docs/main</code> directory. We now have added Snack Player so that you get the glimpse of the component and also get to know how it works. Under the <code>usage</code>, there is a separate folder for each UI Component, where you can add Usage related to component and relevant descriptions.</p><p><strong>Note</strong>: To add Snack demo, add it inside the snack directory. You can add as many Snack which will make our repository more helpful for developers.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="testing-the-changes">Testing the changes<a href="#testing-the-changes" class="hash-link" aria-label="Direct link to Testing the changes" title="Direct link to Testing the changes">​</a></h2><p>For testing the changes in the documentation autogeneration, we simply need to run the following commands in sequence.</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token builtin class-name">cd</span><span class="token plain"> website</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">yarn</span><span class="token plain"> </span><span class="token builtin class-name">test</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>We have also included the changes in the main test process, so this will automatically run with the workflow as well as when you run the <code>yarn test</code> command from root of the project.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="future">Future<a href="#future" class="hash-link" aria-label="Direct link to Future" title="Direct link to Future">​</a></h2><p>Some of the components are class-based. They are: Input, SearchBar, Rating.(from <a href="https://github.com/Monte9/react-native-ratings" target="_blank" rel="noopener noreferrer">https://github.com/Monte9/react-native-ratings</a>). If you change the components to Functional/hooks based please remove it from the array of <code>filesToExclude</code> under <code>website/scripts/docgen/getComponentFiles.ts</code>. These are the paths of the component files for which the process is still manual.</p><p>So, generating the documentation doesn't come up well for these components. Due to the existing structure <code>react-docgen-typescript</code> fails to generate relevant result for them. We are therefore looking for contributions on these components to make them Fuctional/Hooks based.</p><p>Thanks. Hope you like the new workflow. Looking forward for improvements and contributions to it.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Version 2.3 Upgrade Guide]]></title>
            <link>https://reactnativeelements.com/blog/2020/08/10/2.3-upgrade-guide</link>
            <guid>https://reactnativeelements.com/blog/2020/08/10/2.3-upgrade-guide</guid>
            <pubDate>Mon, 10 Aug 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[There have been a lot of changes and improvements coming through the pipeline recently with react-native-elements. So in preparing for a version 3, there are some planned deprecations that will be added into version 2.3 and then removed in version 3.]]></description>
            <content:encoded><![CDATA[<p>There have been a lot of changes and improvements coming through the pipeline recently with <code>react-native-elements</code>. So in preparing for a version 3, there are some planned deprecations that will be added into version 2.3 and then removed in version 3.</p><p>The reason for these changes is that <code>react-native-elements</code> regularly gets requests for new features and enhancements quite frequently. The fast and easy method of adding these new features is usually to add another prop into the component that then injects some change into a child component. Unfortunately, this ends up leading to the components having a lot of props, lots of conditional code, and additional code complexity. The solution going forward and into version 3 will be to break down large components into smaller pieces so that it is easier to inject your own code without having to wait for an additional prop to be added.</p><p>As we continue to build up to version 3, this post will continue to be updated with new step-by-step directions on how to upgrade your code to work around these changes. The RNE team thanks you for your patience, and we hope that you see the value in the upcoming changes.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="avatar">Avatar<a href="#avatar" class="hash-link" aria-label="Direct link to Avatar" title="Direct link to Avatar">​</a></h2><p><code>accessory</code>, <code>showAccessory</code>, and <code>accessoryProps</code> are all being dprecated. There is now a child component <code>Avatar.Accessory</code> that you insert as a child component instead.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Avatar</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Avatar</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Accessory</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token spread operator" style="color:#393A34">...</span><span class="token plain">accessoryProps</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Avatar</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="listitem">ListItem<a href="#listitem" class="hash-link" aria-label="Direct link to ListItem" title="Direct link to ListItem">​</a></h2><p><code>ListItem</code> has a large number of deprecated props. <code>ListItem</code> has been somewhat of a kitchen sink. All the props can be replaced by inserting them as children in the order of left to right as they appear on the screen.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="leftelement-lefticon-leftavatar-rightelement-righticon-rightavatar">leftElement, leftIcon, leftAvatar, rightElement, rightIcon, rightAvatar<a href="#leftelement-lefticon-leftavatar-rightelement-righticon-rightavatar" class="hash-link" aria-label="Direct link to leftElement, leftIcon, leftAvatar, rightElement, rightIcon, rightAvatar" title="Direct link to leftElement, leftIcon, leftAvatar, rightElement, rightIcon, rightAvatar">​</a></h3><p>These can be replaced by using <code>Text</code>, <code>Icon</code>, and <code>Avatar</code> components respectively.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="title-titlestyle-titleprops-subtitle-subtitleprops-subtitlestyle">title, titleStyle, titleProps, subtitle, subtitleProps, subtitleStyle<a href="#title-titlestyle-titleprops-subtitle-subtitleprops-subtitlestyle" class="hash-link" aria-label="Direct link to title, titleStyle, titleProps, subtitle, subtitleProps, subtitleStyle" title="Direct link to title, titleStyle, titleProps, subtitle, subtitleProps, subtitleStyle">​</a></h3><p>These props can be replaced by <code>ListItem.Content</code>, <code>ListItem.Title</code> and <code>ListItem.Subtitle</code></p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">ListItem</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Content</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Title</span><span class="token plain"> style</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">titleStyle</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token spread operator" style="color:#393A34">...</span><span class="token plain">titleProps</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">title</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Title</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Content</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">ListItem</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="contentcontainerstyle-rightcontentcontainerstyle">contentContainerStyle, rightContentContainerStyle<a href="#contentcontainerstyle-rightcontentcontainerstyle" class="hash-link" aria-label="Direct link to contentContainerStyle, rightContentContainerStyle" title="Direct link to contentContainerStyle, rightContentContainerStyle">​</a></h3><p>These props should be placed in the <code>style</code> prop of <code>ListItem.Content</code>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="righttitle-righttitlestyle-righttitleprops-rightsubtitle-rightsubtitlestyle-rightsubtitleprops">rightTitle, rightTitleStyle, rightTitleProps, rightSubtitle, rightSubtitleStyle, rightSubtitleProps<a href="#righttitle-righttitlestyle-righttitleprops-rightsubtitle-rightsubtitlestyle-rightsubtitleprops" class="hash-link" aria-label="Direct link to rightTitle, rightTitleStyle, rightTitleProps, rightSubtitle, rightSubtitleStyle, rightSubtitleProps" title="Direct link to rightTitle, rightTitleStyle, rightTitleProps, rightSubtitle, rightSubtitleStyle, rightSubtitleProps">​</a></h3><p>These props also use <code>ListItem.Content</code>, <code>ListItem.Title</code>, and <code>ListItem.Subtitle</code>. Simply add the prop <code>right</code> to each one.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">ListItem</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Content</span><span class="token plain"> right</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Title</span><span class="token plain"> right style</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">titleStyle</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token spread operator" style="color:#393A34">...</span><span class="token plain">titleProps</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">title</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Title</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">ListItem</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Content</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">ListItem</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="input-buttongroup-switchprops-checkbox-badge-chevron-checkmark">input, buttonGroup, switchProps, checkBox, badge, chevron, checkmark<a href="#input-buttongroup-switchprops-checkbox-badge-chevron-checkmark" class="hash-link" aria-label="Direct link to input, buttonGroup, switchProps, checkBox, badge, chevron, checkmark" title="Direct link to input, buttonGroup, switchProps, checkBox, badge, chevron, checkmark">​</a></h3><p>The <code>input</code> prop can be replaced with <code>ListItem.Input</code>.</p><p>The <code>buttonGroup</code> prop can be replaced with <code>ListItem.ButtonGroup</code>.</p><p>The <code>switchProps</code> prop can be replaced with <code>react-native</code>'s <code>Switch</code>.</p><p>The <code>checkBox</code> prop can be replaced with <code>ListItem.CheckBox</code>.</p><p>The <code>badge</code> prop can be replaced with <code>Badge</code>.</p><p>The <code>chevron</code> prop can be replaced with <code>ListItem.Chevron</code>.</p><p>The <code>checkmark</code> prop can be replaced with :</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Icon</span><span class="token plain"> name</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">"check"</span><span class="token plain"> size</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token number" style="color:#36acaa">20</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="card">Card<a href="#card" class="hash-link" aria-label="Direct link to Card" title="Direct link to Card">​</a></h2><p>For <code>Card</code> the following props have all been deprecated: <code>title</code>, <code>titleStyle</code>, <code>titleNumberOfLines</code>, <code>dividerStyle</code>, <code>image</code>, <code>imageStyle</code>, <code>imageProps</code>, <code>imageWrapperStyle</code>, <code>featuredTitle</code>, <code>featuredTitleStyle</code>, <code>featuredSubtitle</code>, <code>featuredSubtitleStyle</code></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="title-titlestyle-titlenumberoflines">title, titleStyle, titleNumberOfLines<a href="#title-titlestyle-titlenumberoflines" class="hash-link" aria-label="Direct link to title, titleStyle, titleNumberOfLines" title="Direct link to title, titleStyle, titleNumberOfLines">​</a></h3><p>Move these props into <code>Card.Title</code></p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Card</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token maybe-class-name">Card</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Title</span><span class="token plain"> style</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">titleStyle</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> numberOfLines</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">titleNumberOfLines</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">title</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Card</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access maybe-class-name">Title</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token maybe-class-name">Card</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="dividerstyle">dividerStyle<a href="#dividerstyle" class="hash-link" aria-label="Direct link to dividerStyle" title="Direct link to dividerStyle">​</a></h3><p>The divider and the <code>dividerStyle</code> itself were moved into <code>Card.Divider</code></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="image-imagestyle-imageprops-imagewrapperstyle">image, imageStyle, imageProps, imageWrapperStyle<a href="#image-imagestyle-imageprops-imagewrapperstyle" class="hash-link" aria-label="Direct link to image, imageStyle, imageProps, imageWrapperStyle" title="Direct link to image, imageStyle, imageProps, imageWrapperStyle">​</a></h3><p>These can be replaced with <code>Card.Image</code> which accepts all <code>Image</code> props. <code>imageWrapperStyle</code> can be attached to a <code>View</code> that wraps the <code>Image</code></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="featuredtitle-featuredtitlestyle-featuredsubtitle-featuredsubtitlestyle">featuredTitle, featuredTitleStyle, featuredSubtitle, featuredSubtitleStyle<a href="#featuredtitle-featuredtitlestyle-featuredsubtitle-featuredsubtitlestyle" class="hash-link" aria-label="Direct link to featuredTitle, featuredTitleStyle, featuredSubtitle, featuredSubtitleStyle" title="Direct link to featuredTitle, featuredTitleStyle, featuredSubtitle, featuredSubtitleStyle">​</a></h3><p>These were both replaced with <code>Card.FeaturedTitle</code> and <code>Card.FeaturedSubtitle</code></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="bottomsheet">BottomSheet<a href="#bottomsheet" class="hash-link" aria-label="Direct link to BottomSheet" title="Direct link to BottomSheet">​</a></h2><p><code>BottomSheet</code> was added in version 2.2, and it was noted that it had some strict dependencies that weren't so well liked. So <code>BottomSheet</code> has changed completely and it is encouraged that you checkout the docs page on it again.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="dark-mode">Dark Mode<a href="#dark-mode" class="hash-link" aria-label="Direct link to Dark Mode" title="Direct link to Dark Mode">​</a></h2><p>Make sure to checkout the customization page. We added a dark mode configuration to the <code>ThemeProvider</code> that should help out in bootstrapping your app's dark mode.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Elements 1.0]]></title>
            <link>https://reactnativeelements.com/blog/2019/01/27/1.0-release</link>
            <guid>https://reactnativeelements.com/blog/2019/01/27/1.0-release</guid>
            <pubDate>Sun, 27 Jan 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[React Native Elements has UI elements that are easy to use & really customizable. It also has theming, platform specific search bars, React Native Web support, and much more.]]></description>
            <content:encoded><![CDATA[<blockquote><p>React Native Elements has UI elements that are easy to use &amp; really customizable. It also has theming, platform specific search bars, <a href="https://github.com/necolas/react-native-web" target="_blank" rel="noopener noreferrer">React Native Web</a> support, and much more.</p></blockquote><p>It's finally here! Let's put our hands together and welcome React Native Elements 1.0 🎉</p><p>This release is centered around making RNE components that everyone loves more intuitive to use &amp; stable. This is not to say that all the work is done, but this is definitely a giant leap in the right direction and one that we have been working on for over a year.</p><p>I want like to say thank you to our users for using RNE and giving us feedback through issues on the repo and also the contributors who have the taken time to contribute and help improve RNE together. Finally, I'd like to say a big thanks to <a href="https://twitter.com/roach_iam" target="_blank" rel="noopener noreferrer">Kyle Roach</a> and <a href="https://twitter.com/xaviervllgr" target="_blank" rel="noopener noreferrer">Xavier Villelégier</a> without whom this project would not have been as awesome as it is today!!</p><p>This blog post is meant to serve as a migration guide for upgrading to <code>react-native-elements: "^1.0.0"</code> from <code>0.19.1</code> and also a way to document and share all the breaking changes, new features and other improvements in this release. For those updating from <code>1.0.0-beta7</code> you can view those release notes <a href="https://github.com/react-native-elements/react-native-elements/releases/tag/v1.0.0" target="_blank" rel="noopener noreferrer">here</a>.</p><p>The wait is over!! Get excited, cause we certainly are. 14K 🌟 and counting...</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="installation">Installation<a href="#installation" class="hash-link" aria-label="Direct link to Installation" title="Direct link to Installation">​</a></h2><p>First, install the library using your favorite package manager: <code>yarn add react-native-elements</code></p><p>Also if you are using an older version, just update the <code>react-native-elements</code> version in <code>package.json</code> to <code>^1.0.0</code></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="breaking-changes">Breaking changes<a href="#breaking-changes" class="hash-link" aria-label="Direct link to Breaking changes" title="Direct link to Breaking changes">​</a></h2><ul><li><p>Updated all components that have the <code>component</code> prop to <code>Component</code> prop as per convention (<a href="https://github.com/react-native-elements/react-native-elements/pull/1479" target="_blank" rel="noopener noreferrer">#1479</a>)</p></li><li><p>Some colors have been removed from the colors file and some changed. Here's the list of colors from 0.19.1.</p></li></ul><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">primary</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#9E9E9E'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">primary1</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#4d86f7'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">primary2</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#6296f9'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">secondary</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#8F0CE8'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">secondary2</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#00B233'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">secondary3</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#00FF48'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">grey0</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#393e42'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">grey1</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#43484d'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">grey2</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#5e6977'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">grey3</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#86939e'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">grey4</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#bdc6cf'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">grey5</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#e1e8ee'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">dkGreyBg</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#232323'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">greyOutline</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#bbb'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">searchBg</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#303337'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">disabled</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#dadee0'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">white</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#ffffff'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">error</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'#ff190c'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="avatar"><code>Avatar</code><a href="#avatar" class="hash-link" aria-label="Direct link to avatar" title="Direct link to avatar">​</a></h3><ul><li>Props <code>small</code>, <code>medium</code>, <code>large</code>, <code>xlarge</code> have been removed. Usage is now <code>size="small"</code> etc. <a href="https://github.com/react-native-elements/react-native-elements/pull/1098" target="_blank" rel="noopener noreferrer">#1098</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="badge"><code>Badge</code><a href="#badge" class="hash-link" aria-label="Direct link to badge" title="Direct link to badge">​</a></h3><ul><li><code>wrapperStyle</code> prop has been removed - use <code>containerStyle</code> prop instead (<a href="https://github.com/react-native-elements/react-native-elements/pull/1545" target="_blank" rel="noopener noreferrer">#1545</a>)</li><li><code>badgeStyle</code> prop replaces previous behaviour of <code>containerStyle</code> prop (<a href="https://github.com/react-native-elements/react-native-elements/pull/1545" target="_blank" rel="noopener noreferrer">#1545</a>)</li><li><code>element</code> prop which was undocumented is removed - use <code>value</code> prop instead (<a href="https://github.com/react-native-elements/react-native-elements/pull/1545" target="_blank" rel="noopener noreferrer">#1545</a>)</li><li>can no longer render children - instead use <code>value</code> prop which now supports rendering react components (<a href="https://github.com/react-native-elements/react-native-elements/pull/1545" target="_blank" rel="noopener noreferrer">#1545</a>)</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="button"><code>Button</code><a href="#button" class="hash-link" aria-label="Direct link to button" title="Direct link to button">​</a></h3><ul><li>By default on Android there's no more elevation (<a href="https://github.com/react-native-elements/react-native-elements/pull/1538" target="_blank" rel="noopener noreferrer">#1538</a>). To get elevation, use the <code>raised</code> prop.</li><li>Renamed <code>textStyle</code> to <code>titleStyle</code></li><li>Renamed <code>containerViewStyle</code> to <code>containerStyle</code></li><li>Removed props <code>transparent</code> and <code>outline</code> (<a href="https://github.com/react-native-elements/react-native-elements/pull/1540" target="_blank" rel="noopener noreferrer">#1540</a>). Instead use the <code>type</code> prop.</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// Transparent</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">Button</span><span class="token tag" style="color:#00009f"> </span><span class="token tag attr-name" style="color:#00a4db">type</span><span class="token tag attr-value punctuation attr-equals" style="color:#393A34">=</span><span class="token tag attr-value punctuation" style="color:#393A34">"</span><span class="token tag attr-value" style="color:#e3116c">clear</span><span class="token tag attr-value punctuation" style="color:#393A34">"</span><span class="token tag" style="color:#00009f"> </span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// Outline</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">Button</span><span class="token tag" style="color:#00009f"> </span><span class="token tag attr-name" style="color:#00a4db">type</span><span class="token tag attr-value punctuation attr-equals" style="color:#393A34">=</span><span class="token tag attr-value punctuation" style="color:#393A34">"</span><span class="token tag attr-value" style="color:#e3116c">outline</span><span class="token tag attr-value punctuation" style="color:#393A34">"</span><span class="token tag" style="color:#00009f"> </span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li>Removed props <code>secondary</code>, <code>secondary2</code>, <code>secondary3</code>, <code>primary1</code>, <code>primary2</code>, <code>backgroundColor</code>. Use the <code>buttonStyle</code> prop to set the background color.</li><li>Removed <code>iconComponent</code> prop. If you want to use a different Icon component - the <code>icon</code> prop supports custom elements.</li><li>Removed <code>loadingRight</code> prop. Loading indicator <strong>displays without title</strong>. May re-add in future.</li><li>Removed <code>borderRadius</code> prop. To control the border radius use the <code>buttonStyle</code> prop.</li><li>Removed props <code>color</code>, <code>fontSize</code>, <code>fontWeight</code>, and <code>fontFamily</code>. Instead use the <code>titleStyle</code> prop to set attributes for the title.</li><li>Removed <code>large</code> prop. May re-add in future.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="buttongroup"><code>ButtonGroup</code><a href="#buttongroup" class="hash-link" aria-label="Direct link to buttongroup" title="Direct link to buttongroup">​</a></h3><ul><li><code>disableSelected</code> prop has been removed (<a href="https://github.com/react-native-elements/react-native-elements/pull/1587" target="_blank" rel="noopener noreferrer">#1587</a>)</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="card"><code>Card</code><a href="#card" class="hash-link" aria-label="Direct link to card" title="Direct link to card">​</a></h3><ul><li><code>fontFamily</code> prop is deprecated - instead use <code>titleStyle</code> prop (<a href="https://github.com/react-native-elements/react-native-elements/pull/1587" target="_blank" rel="noopener noreferrer">#1659</a>)</li><li><code>flexDirection</code> prop is deprecated - instead use <code>wrapperStyle</code> prop (<a href="https://github.com/react-native-elements/react-native-elements/pull/1587" target="_blank" rel="noopener noreferrer">#1659</a>)</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="form"><code>Form</code><a href="#form" class="hash-link" aria-label="Direct link to form" title="Direct link to form">​</a></h3><ul><li><p><code>FormInput</code> been renamed to <code>Input</code> (<a href="https://github.com/react-native-elements/react-native-elements/pull/497" target="_blank" rel="noopener noreferrer">#497</a>)</p><ul><li><code>clearText</code> method renamed to <code>clear</code></li><li><code>textInputRef</code> and <code>containerRef</code> props removed</li><li><code>normalizeFontSize</code> prop removed. You can use the <code>normalize</code> helper along with the <code>inputStyle</code> prop to normalize font sizes.</li></ul></li><li><p><code>FormLabel</code> has been removed. This is now built into the <code>Input</code> component by use of <code>label</code> prop. Props <code>labelStyle</code> and <code>labelProps</code> can be used to customize it.</p></li><li><p><code>FormValidationMessage</code> has been removed. This is now built into the <code>Input</code> component by use of <code>errorMessage</code> prop. Props <code>errorStyle</code> and <code>errorProps</code> can be used to customize it.</p></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="header"><code>Header</code><a href="#header" class="hash-link" aria-label="Direct link to header" title="Direct link to header">​</a></h3><ul><li>Props <code>innerContainerStyles</code>, <code>outerContainerStyles</code> removed <a href="https://github.com/react-native-elements/react-native-elements/pull/1221" target="_blank" rel="noopener noreferrer">#1221</a>. Instead use the <code>containerStyle</code> prop for main styling, along with props <code>leftContainerStyle</code>, <code>centerContainerStyle</code>, and <code>rightContainerStyle</code> when needed.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="searchbar"><code>SearchBar</code><a href="#searchbar" class="hash-link" aria-label="Direct link to searchbar" title="Direct link to searchbar">​</a></h3><p>SearchBar now supports different platform styles! To get an iOS or Android themed SearchBar, use the <code>platform</code> prop. <code>platform="ios"</code> or <code>platform="android"</code></p><ul><li><code>noIcon</code> prop removed. Instead to remove the search icon use the <code>searchIcon</code> prop. E.g <code>searchIcon={null}</code></li><li><code>showLoadingIcon</code> prop renamed to <code>showLoading</code> <a href="https://github.com/react-native-elements/react-native-elements/pull/837" target="_blank" rel="noopener noreferrer">#837</a></li><li><code>containerRef</code> prop removed</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="list"><code>List</code><a href="#list" class="hash-link" aria-label="Direct link to list" title="Direct link to list">​</a></h3><ul><li><strong><code>List</code> component has been removed!</strong> <code>List</code> was just a regular React Native View with some small margin styles. It wasn't actually needed to use the <code>ListItem</code> component. Instead we recommend using the <a href="https://reactnative.dev/docs/flatlist" target="_blank" rel="noopener noreferrer"><code>FlatList</code></a> or <a href="https://reactnative.dev/docs/sectionlist" target="_blank" rel="noopener noreferrer"><code>SectionList</code></a> components from React Native which function both as Views and also displaying items, pull to refresh and more.</li><li>If you want to apply the same styles that the <code>List</code> component provided prior to 1.0, <a href="https://github.com/react-native-elements/react-native-elements/issues/1565#issuecomment-436982251" target="_blank" rel="noopener noreferrer">see this comment</a>.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="listitem"><code>ListItem</code><a href="#listitem" class="hash-link" aria-label="Direct link to listitem" title="Direct link to listitem">​</a></h3><ul><li><code>leftIconOnPress</code>, <code>leftIconOnLongPress</code>, <code>leftIconUnderlayColor</code>, and <code>leftIconContainerStyle</code>, removed. The <code>leftIcon</code> prop can accept props.</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">ListItem</span><span class="token tag" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag" style="color:#00009f">  </span><span class="token tag attr-name" style="color:#00a4db">title</span><span class="token tag attr-value punctuation attr-equals" style="color:#393A34">=</span><span class="token tag attr-value punctuation" style="color:#393A34">"</span><span class="token tag attr-value" style="color:#e3116c">Yea</span><span class="token tag attr-value punctuation" style="color:#393A34">"</span><span class="token tag" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag" style="color:#00009f">  </span><span class="token tag attr-name" style="color:#00a4db">leftIcon</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">name</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript string" style="color:#e3116c">'home'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript function-variable function" style="color:#d73a49">onPress</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript arrow operator" style="color:#393A34">=&gt;</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript function" style="color:#d73a49">alert</span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript string" style="color:#e3116c">'hello'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag" style="color:#00009f"></span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li><code>avatar</code>, <code>avatarStyle</code>, <code>avatarContainerStyle</code>, <code>roundAvatar</code>, and <code>avatarOverlayContainerStyle</code> removed. Avatars can now be customized using the <code>rightAvatar</code> and <code>leftAvatar</code> props which can either render a custom element or an object that describes the props from Avatar.</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">ListItem</span><span class="token tag" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag" style="color:#00009f">  </span><span class="token tag attr-name" style="color:#00a4db">leftAvatar</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag script language-javascript" style="color:#00009f">    </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">title</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript string" style="color:#e3116c">'MD'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag script language-javascript" style="color:#00009f">    </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">rounded</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript boolean" style="color:#36acaa">false</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag script language-javascript" style="color:#00009f">    </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">containerStyle</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">margin</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript number" style="color:#36acaa">5</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag script language-javascript" style="color:#00009f">    </span><span class="token tag script language-javascript function-variable function" style="color:#d73a49">onPress</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript arrow operator" style="color:#393A34">=&gt;</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript function" style="color:#d73a49">alert</span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript string" style="color:#e3116c">'hey'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag script language-javascript" style="color:#00009f">  </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag" style="color:#00009f">  </span><span class="token tag attr-name" style="color:#00a4db">rightAvatar</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">title</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript string" style="color:#e3116c">'DW'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript function-variable function" style="color:#d73a49">onLongPress</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript arrow operator" style="color:#393A34">=&gt;</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript function" style="color:#d73a49">alert</span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript string" style="color:#e3116c">'hey'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"></span><br></span><span class="token-line" style="color:#393A34"><span class="token tag" style="color:#00009f"></span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li><code>wrapperStyle</code> prop removed. Use the <code>containerStyle</code> prop instead.</li><li><code>titleNumberOfLines</code>, <code>subtitleNumberOfLines</code>, and <code>rightTitleNumberOfLines</code> props removed. Use the <code>titleProps</code>, <code>rightTitleProps</code>, and <code>subtitleProps</code> props to pass props for each..</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">ListItem</span><span class="token tag" style="color:#00009f"> </span><span class="token tag attr-name" style="color:#00a4db">titleProps</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">numberOfLines</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript number" style="color:#36acaa">4</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"> </span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li><code>hideChevron</code> removed. Use the <code>chevron</code> prop instead. However, the behaviour is swapped <code>hideChevron={true}</code> behaves like <code>chevron={false}</code></li><li><code>chevronColor</code> removed. The <code>chevron</code> prop now can accept an object describing it's appearance.</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">ListItem</span><span class="token tag" style="color:#00009f"> </span><span class="token tag attr-name" style="color:#00a4db">chevron</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">color</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript string" style="color:#e3116c">'pink'</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"> </span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li><code>fontFamily</code> removed. Use the <code>titleStyle</code> and <code>subTitleStyle</code> props to set change the text styling</li><li><code>titleContainerStyle</code> removed. Use the <code>titleStyle</code> prop instead.</li><li><code>rightTitleContainerStyle</code> removed. Use the <code>rightTitleStyle</code> prop instead.</li><li><code>subtitleContainerStyle</code> removed. Use the <code>subtitleStyle</code> prop instead.</li><li><code>label</code> prop removed.</li><li><code>switchButton</code>, <code>onSwitch</code>, <code>switchDisabled</code>, <code>switchOnTintColor</code>, <code>switchThumbTintColor</code>, <code>switchTintColor</code>, and <code>switched</code> removed. Instead use the <code>switch</code> prop wich accepts an object describing its props.</li><li><code>textInput</code>,<code>textInputAutoCapitalize</code>,<code>textInputAutoCorrect</code>,<code>textInputAutoFocus</code>,<code>textInputEditable</code>,<code>textInputKeyboardType</code>,<code>textInputMaxLength</code>,<code>textInputMultiline</code>,<code>textInputOnChangeText</code>,<code>textInputOnFocus</code>,<code>textInputOnBlur</code>,<code>textInputSelectTextOnFocus</code>,<code>textInputReturnKeyType</code>,<code>textInputValue</code>,<code>textInputSecure</code>,<code>textInputStyle</code>,<code>textInputContainerStyle</code>,<code>textInputPlaceholder</code> removed. We now expose a single <code>input</code> prop which accepts an object describing its props.</li><li><code>onPressRightIcon</code> removed. Use the <code>rightIcon</code> prop which can accept an object now describing its props.</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">ListItem</span><span class="token tag" style="color:#00009f"> </span><span class="token tag attr-name" style="color:#00a4db">rightIcon</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">name</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript string" style="color:#e3116c">'home'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">,</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript function-variable function" style="color:#d73a49">onPress</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript arrow operator" style="color:#393A34">=&gt;</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript console class-name" style="color:#00009f">console</span><span class="token tag script language-javascript punctuation" style="color:#393A34">.</span><span class="token tag script language-javascript method function property-access" style="color:#d73a49">log</span><span class="token tag script language-javascript punctuation" style="color:#393A34">(</span><span class="token tag script language-javascript string" style="color:#e3116c">'clicked'</span><span class="token tag script language-javascript punctuation" style="color:#393A34">)</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"> </span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="pricingcard"><code>PricingCard</code><a href="#pricingcard" class="hash-link" aria-label="Direct link to pricingcard" title="Direct link to pricingcard">​</a></h3><ul><li><code>titleFont</code> removed. Use the <code>titleStyle</code> prop instead to customize the title. <a href="https://github.com/react-native-elements/react-native-elements/pull/1231" target="_blank" rel="noopener noreferrer">#1231</a></li><li><code>pricingFont</code> removed. Use the <code>pricingStyle</code> prop instead to customize the price. <a href="https://github.com/react-native-elements/react-native-elements/pull/1231" target="_blank" rel="noopener noreferrer">#1231</a></li><li><code>infoFont</code> removed. Use the <code>infoStyle</code> prop instead to customize the info. <a href="https://github.com/react-native-elements/react-native-elements/pull/1231" target="_blank" rel="noopener noreferrer">#1231</a></li><li><code>buttonFont</code> removed. Use the <code>button</code> prop with a <code>buttonStyle</code> key to set this.</li></ul><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token tag punctuation" style="color:#393A34">&lt;</span><span class="token tag class-name" style="color:#00009f">PricingCard</span><span class="token tag" style="color:#00009f"> </span><span class="token tag attr-name" style="color:#00a4db">button</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#393A34">=</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">buttonStyle</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">{</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript literal-property property" style="color:#36acaa">fontFamily</span><span class="token tag script language-javascript operator" style="color:#393A34">:</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript string" style="color:#e3116c">'Arial'</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript" style="color:#00009f"> </span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag script language-javascript punctuation" style="color:#393A34">}</span><span class="token tag" style="color:#00009f"> </span><span class="token tag punctuation" style="color:#393A34">/&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="text"><code>Text</code><a href="#text" class="hash-link" aria-label="Direct link to text" title="Direct link to text">​</a></h3><ul><li><code>fontFamily</code> prop is removed - instead use <code>style</code> prop (<a href="https://github.com/react-native-elements/react-native-elements/pull/1587" target="_blank" rel="noopener noreferrer">#1659</a>)</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="new-features">New features<a href="#new-features" class="hash-link" aria-label="Direct link to New features" title="Direct link to New features">​</a></h2><ul><li>Support for React Native Web - read more on it <a href="/blog/2018/12/13/react-native-web">here</a> (<a href="https://github.com/react-native-elements/react-native-elements/pull/1664" target="_blank" rel="noopener noreferrer">#1664</a>)</li><li>Theming support across components - easily build light &amp; dark modes and theme your components from one place (<a href="https://github.com/react-native-elements/react-native-elements/pull/1454" target="_blank" rel="noopener noreferrer">#1454</a>)</li><li>New <code>&lt;Image /&gt;</code> Component - displays images with a placeholder and smooth image load transitioning (<a href="https://github.com/react-native-elements/react-native-elements/pull/1582" target="_blank" rel="noopener noreferrer">#1582</a>)</li><li>New <code>&lt;Input /&gt;</code> Component - a branch new and improved replacement for <code>&lt;FormInput /&gt;</code> (<a href="https://github.com/react-native-elements/react-native-elements/pull/497" target="_blank" rel="noopener noreferrer">#497</a>)</li><li>New <code>withBadge</code> HOC allows you to easily add badges to icons and other components (<a href="https://github.com/react-native-elements/react-native-elements/pull/1604" target="_blank" rel="noopener noreferrer">#1604</a>)</li><li>New "mini badge" with the <code>&lt;Badge /&gt;</code> component - Perfect for status indicators and notifications <a href="https://github.com/react-native-elements/react-native-elements/pull/1545" target="_blank" rel="noopener noreferrer">#1545</a></li><li>New Tap Rating <code>&lt;AirbnbRating /&gt;</code> component - powered by <code>react-native-ratings</code> (<a href="https://github.com/react-native-elements/react-native-elements/pull/1671" target="_blank" rel="noopener noreferrer">#1671</a>)</li><li>Platform-specific <code>&lt;SearchBar /&gt;</code> component - drop-in usage with native look and feel (<a href="https://github.com/react-native-elements/react-native-elements/pull/837" target="_blank" rel="noopener noreferrer">#837</a>)</li><li><code>&lt;Slider /&gt;</code> Component - supports <code>vertical</code> orientation (<a href="https://github.com/react-native-elements/react-native-elements/pull/1698" target="_blank" rel="noopener noreferrer">#1698</a>)</li><li>Button types! Easily have solid, clear, and outline buttons with one prop. (<a href="https://github.com/react-native-elements/react-native-elements/pull/1540" target="_blank" rel="noopener noreferrer">#1540</a>)</li><li>Background image support in the <code>&lt;Header /&gt;</code> (<a href="https://github.com/react-native-elements/react-native-elements/pull/1556" target="_blank" rel="noopener noreferrer">#1556</a>)</li><li>Add support for <code>AntDesign</code> icons (<a href="https://github.com/react-native-elements/react-native-elements/pull/1529" target="_blank" rel="noopener noreferrer">#1529</a>)</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="assorted-fixes--improvements">Assorted fixes &amp; improvements<a href="#assorted-fixes--improvements" class="hash-link" aria-label="Direct link to Assorted fixes &amp; improvements" title="Direct link to Assorted fixes &amp; improvements">​</a></h2><ul><li>Updated <code>react-native-vector-icons</code> peerDependency to <code>&gt;4.2.0</code></li><li>Expose <code>helpers</code> methods that are used internally</li><li>Close to 100% types coverage</li><li>Docs<ul><li>Add descriptions for every Component (<a href="https://github.com/react-native-elements/react-native-elements/pull/1527" target="_blank" rel="noopener noreferrer">#1527</a>)</li><li>Add central place to show supported icon sets (<a href="https://github.com/react-native-elements/react-native-elements/pull/1532" target="_blank" rel="noopener noreferrer">#1532</a>)</li><li>Added Showcase section to display apps using RNE (<a href="https://github.com/react-native-elements/react-native-elements/pull/1704" target="_blank" rel="noopener noreferrer">#1704</a>)</li></ul></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="ecosystem-and-web-support">Ecosystem and web support<a href="#ecosystem-and-web-support" class="hash-link" aria-label="Direct link to Ecosystem and web support" title="Direct link to Ecosystem and web support">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="independent-projects">Independent Projects<a href="#independent-projects" class="hash-link" aria-label="Direct link to Independent Projects" title="Direct link to Independent Projects">​</a></h3><ul><li>Mock iOS Settings Screen - Check it out on the <a href="https://github.com/Monte9/react-native-elements-app" target="_blank" rel="noopener noreferrer">RNE-App here</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="web-support">Web Support<a href="#web-support" class="hash-link" aria-label="Direct link to Web Support" title="Direct link to Web Support">​</a></h3><ul><li>Follow <a href="/blog/2018/12/13/react-native-web">this detailed Blog Post</a> to use RNElements with RNWeb</li></ul><blockquote><p>Lastly, here is the RNE v1 release in numbers:</p><ul><li>470 commits (with over 272 PR's)</li><li>371 files changes (52,920 additions and 32,737 deletions)</li><li>Over 80 contributors</li><li>Over \$1500 awarded to contributors</li></ul></blockquote><hr><p>Thanks for reading! Feel free to share this post if you enjoyed reading it.</p><p>If you run into any trouble using RNE, please open a new issue <a href="https://github.com/react-native-elements/react-native-elements/issues" target="_blank" rel="noopener noreferrer">here</a>. Also if you want to support us, you can contribute to our Open Collective <a href="https://opencollective.com/react-native-elements" target="_blank" rel="noopener noreferrer">here</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Web]]></title>
            <link>https://reactnativeelements.com/blog/2018/12/13/react-native-web</link>
            <guid>https://reactnativeelements.com/blog/2018/12/13/react-native-web</guid>
            <pubDate>Thu, 13 Dec 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[Comprehensive Guide to create simple app using React Native Web and React Native Elements]]></description>
            <content:encoded><![CDATA[<blockquote><p>Comprehensive Guide to create simple app using React Native Web and React Native&nbsp;Elements</p></blockquote><p>Case study: <code>gitphone</code>, GitHub repository checker for your smartphone.</p><img loading="lazy" src="https://cdn-images-1.medium.com/max/1000/1*PHcPxP963ascQkeZOqy-rQ.png" class="img_ev3q"><h2 class="anchor anchorWithStickyNavbar_LWe7" id="toc">ToC<a href="#toc" class="hash-link" aria-label="Direct link to ToC" title="Direct link to ToC">​</a></h2><ul><li>Initialize the project using <a href="https://github.com/VISI-ONE/create-react-native-web-app" target="_blank" rel="noopener noreferrer">CRNWA</a></li><li>Make sure everything works: Android, iOS and Web</li><li>Add RNE latest ( 1.0.0-beta7 ) to the project</li><li>Add 2 screens</li></ul><p>Screen 1 RNE components:</p><ol><li>Input</li><li>Button with Icon</li></ol><p>Screen 2 RNE components:</p><ol><li>Header</li><li>ListItem</li><li>Avatar</li><li>Text</li></ol><p><code>gitphone</code> should have:</p><ul><li>routing, <a href="https://reacttraining.com/react-router" target="_blank" rel="noopener noreferrer">react-router</a>. It works great both on Native and Web.</li><li>calls to GitHub API. See <a href="https://developer.github.com/v3/" target="_blank" rel="noopener noreferrer">https://developer.github.com/v3/</a>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="0️⃣-initialstep">0️⃣ Initial&nbsp;Step<a href="#0️⃣-initialstep" class="hash-link" aria-label="Direct link to 0️⃣ Initial&nbsp;Step" title="Direct link to 0️⃣ Initial&nbsp;Step">​</a></h2><p>Install create-react-native-web-app</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ npm i </span><span class="token operator" style="color:#393A34">-</span><span class="token plain">g create</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">web</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">app</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="1️⃣-firststep">1️⃣ First&nbsp;Step<a href="#1️⃣-firststep" class="hash-link" aria-label="Direct link to 1️⃣ First&nbsp;Step" title="Direct link to 1️⃣ First&nbsp;Step">​</a></h2><p>Create <code>gitphone</code> project.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">λ create</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">web</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">app gitphone</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">⏳ Creating React Native Web App by the name </span><span class="token keyword" style="color:#00009f">of</span><span class="token plain"> gitphone </span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">✅ Created project folder</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">✅ Added project files</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">⏳ Installing project dependencies</span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">yarn install v1</span><span class="token punctuation" style="color:#393A34">.</span><span class="token number" style="color:#36acaa">10.1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">1</span><span class="token operator" style="color:#393A34">/</span><span class="token number" style="color:#36acaa">4</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> Resolving packages</span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">2</span><span class="token operator" style="color:#393A34">/</span><span class="token number" style="color:#36acaa">4</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> Fetching packages</span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">info fsevents</span><span class="token decorator at operator" style="color:#393A34">@</span><span class="token decorator function" style="color:#d73a49">1</span><span class="token number" style="color:#36acaa">.2</span><span class="token number" style="color:#36acaa">.4</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> The platform </span><span class="token string" style="color:#e3116c">"win32"</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">is</span><span class="token plain"> incompatible </span><span class="token keyword" style="color:#00009f">with</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">this</span><span class="token plain"> module</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">info </span><span class="token string" style="color:#e3116c">"fsevents@1.2.4"</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">is</span><span class="token plain"> an optional dependency and failed compatibility check</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"> Excluding it from installation</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">3</span><span class="token operator" style="color:#393A34">/</span><span class="token number" style="color:#36acaa">4</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> Linking dependencies</span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">[</span><span class="token number" style="color:#36acaa">4</span><span class="token operator" style="color:#393A34">/</span><span class="token number" style="color:#36acaa">4</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"> Building fresh packages</span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">success Saved lockfile</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Done </span><span class="token keyword" style="color:#00009f">in</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">797</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">66s</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">✅ Installed project dependencies</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">✅ Done</span><span class="token operator" style="color:#393A34">!</span><span class="token plain"> 😁👍 Your project </span><span class="token keyword" style="color:#00009f">is</span><span class="token plain"> ready </span><span class="token keyword" style="color:#00009f">for</span><span class="token plain"> development</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> change directory to your </span><span class="token keyword" style="color:#00009f">new</span><span class="token plain"> </span><span class="token class-name">project</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ cd gitphone</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ Then run the these commands to </span><span class="token keyword" style="color:#00009f">get</span><span class="token plain"> started</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> To run development Web server</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn web</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> To run Android on connected </span><span class="token function" style="color:#d73a49">device</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">after installing Android Debug Bridge </span><span class="token string" style="color:#e3116c">"adb"</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">-</span><span class="token plain"> https</span><span class="token operator" style="color:#393A34">:</span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">developer</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">android</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">com</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">studio</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">releases</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">platform</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">tools</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn android</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> To run ios </span><span class="token function" style="color:#d73a49">simulator</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">after installing Xcode </span><span class="token operator" style="color:#393A34">-</span><span class="token plain"> only on Apple devices</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn ios</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> To run tests </span><span class="token keyword" style="color:#00009f">for</span><span class="token plain"> Native and Web</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn test</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> To run build </span><span class="token keyword" style="color:#00009f">for</span><span class="token plain"> Web</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn build</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Change to <code>gitphone</code> directory and test the web app by running <code>yarn web</code>.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">Starting the development server</span><span class="token operator" style="color:#393A34">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Compiled successfully</span><span class="token operator" style="color:#393A34">!</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">You can now view create</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">web</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">app </span><span class="token keyword" style="color:#00009f">in</span><span class="token plain"> the browser</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Local</span><span class="token operator" style="color:#393A34">:</span><span class="token plain">            http</span><span class="token operator" style="color:#393A34">:</span><span class="token operator" style="color:#393A34">/</span><span class="token regex regex-delimiter" style="color:#36acaa">/</span><span class="token regex regex-source language-regex" style="color:#36acaa">localhost:3001</span><span class="token regex regex-delimiter" style="color:#36acaa">/</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">On Your Network</span><span class="token operator" style="color:#393A34">:</span><span class="token plain">  http</span><span class="token operator" style="color:#393A34">:</span><span class="token operator" style="color:#393A34">/</span><span class="token regex regex-delimiter" style="color:#36acaa">/</span><span class="token regex regex-source language-regex" style="color:#36acaa">172.26.235.145:3001</span><span class="token regex regex-delimiter" style="color:#36acaa">/</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Note that the development build </span><span class="token keyword" style="color:#00009f">is</span><span class="token plain"> not optimized</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">To create a production build</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> use yarn build</span><span class="token punctuation" style="color:#393A34">.</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><img loading="lazy" src="https://cdn-images-1.medium.com/max/800/1*tmq9VHw3S4cgxfWg8xN3gQ.png" width="300" class="img_ev3q"><p>Now, test the <code>gitphone</code> android app by running <code>yarn android</code>.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">Installing </span><span class="token constant" style="color:#36acaa">APK</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'app-debug.apk'</span><span class="token plain"> on </span><span class="token string" style="color:#e3116c">'Redmi 4X - 7.1.2'</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">for</span><span class="token plain"> app</span><span class="token operator" style="color:#393A34">:</span><span class="token plain">debug</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Installed on </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"> device</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token constant" style="color:#36acaa">BUILD</span><span class="token plain"> </span><span class="token constant" style="color:#36acaa">SUCCESSFUL</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Total time</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">21.783</span><span class="token plain"> secs</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Starting</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> Intent </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> cmp</span><span class="token operator" style="color:#393A34">=</span><span class="token plain">com</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">creaternwapp</span><span class="token operator" style="color:#393A34">/</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">MainActivity </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">✨  Done </span><span class="token keyword" style="color:#00009f">in</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">25</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">64s</span><span class="token punctuation" style="color:#393A34">.</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If the build successful, you'll see the app installed on your Android (emulator) device.</p><img loading="lazy" src="https://cdn-images-1.medium.com/max/800/1*BddouTisdXvDzY5vB9U3pQ.png" width="300" class="img_ev3q"><p>But if you got an error when run <code>yarn android</code>, please see Troubleshooting section below.</p><p>The last part for First Step, make sure it can be run on iOS without any problem. Run <code>yarn ios</code> and <em>voila!</em></p><img loading="lazy" src="https://cdn-images-1.medium.com/max/800/1*6AHlumHN29RANlXsrXDu4g.png" width="300" class="img_ev3q"><h2 class="anchor anchorWithStickyNavbar_LWe7" id="2️⃣-steptwo">2️⃣ Step&nbsp;Two<a href="#2️⃣-steptwo" class="hash-link" aria-label="Direct link to 2️⃣ Step&nbsp;Two" title="Direct link to 2️⃣ Step&nbsp;Two">​</a></h2><p>Installing React Native Elements (RNE).</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn add react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">elements</span><span class="token decorator at operator" style="color:#393A34">@</span><span class="token decorator function" style="color:#d73a49">beta</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Installing React Native Vector Icons (RNVI).</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn add react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">vector</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">icons</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Linking:</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native link react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">vector</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">icons</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Both RNE and RNVI are written using es6. If you run <code>yarn web</code> at this point, you'll got an error.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">.</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">node_modules</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">elements</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">src</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">config</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">withTheme</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">js</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Module parse failed</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> Unexpected </span><span class="token function" style="color:#d73a49">token</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token number" style="color:#36acaa">12</span><span class="token operator" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">28</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">You may need an appropriate loader to handle </span><span class="token keyword" style="color:#00009f">this</span><span class="token plain"> file type</span><span class="token punctuation" style="color:#393A34">.</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>We need to tell webpack to transpile them.</p><ol><li>Open <code>config/webpack.config.dev.js</code></li><li>On line 141 <code>Process JS with babel</code>, add RNE and RNVI to include</li><li>Do the same for <code>config/webpack.config.prod.js</code> as well 👌</li></ol><p>If you get lost, see this <a href="https://gist.github.com/haruelrovix/01d335dfcabec17a6aa5bc7a53fef277" target="_blank" rel="noopener noreferrer">gist</a> or commit <a href="https://github.com/haruelrovix/gitphone/commit/8c0e6036d9231cc934285502528a2061b848ce2d" target="_blank" rel="noopener noreferrer">8c0e603</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="3️⃣-give-it-atry">3️⃣ Give it a&nbsp;try<a href="#3️⃣-give-it-atry" class="hash-link" aria-label="Direct link to 3️⃣ Give it a&nbsp;try" title="Direct link to 3️⃣ Give it a&nbsp;try">​</a></h2><p>Now, let's grasp the idea how RNE works.</p><ol><li><p>Open src/App.js</p></li><li><p>Import Button from RNE</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> Button </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'react-native-elements'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>On render, change TouchableHighlight to use RNE's Button</p></li><li><p>Run yarn ios, yarn android and yarn web to see it in action! 👏</p></li></ol><p>Note: If you got an error <code>Could not find com.android.tools.build.appt2</code> when running <code>yarn android</code>, add <code>google</code> on the gradle repositories.</p><p>See this <a href="https://gist.github.com/haruelrovix/51a695a4fe292767bedc32ec638f9736" target="_blank" rel="noopener noreferrer">gist</a> or commit for the details: <a href="https://github.com/haruelrovix/gitphone/commit/a2ebba14aef533925b593933fa885e2f990b2ace" target="_blank" rel="noopener noreferrer">a2ebba1</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="4️⃣-add-home-component">4️⃣ Add Home component<a href="#4️⃣-add-home-component" class="hash-link" aria-label="Direct link to 4️⃣ Add Home component" title="Direct link to 4️⃣ Add Home component">​</a></h2><p>Our first component will be <code>Home</code>. On this component, there are two input fields and one Submit button.</p><ol><li>Inside <code>src</code>, create new folder: <code>Components</code></li><li>Add new file called <code>Home.js</code> <a href="https://gist.github.com/haruelrovix/04eeb6c4d8d0cc56e041e5be2c20bc97" target="_blank" rel="noopener noreferrer">gist</a></li><li>On <code>App.js</code>, import <code>Home</code> component <a href="https://gist.github.com/haruelrovix/15cd4badc3a9ec949037b19d9195d6bc" target="_blank" rel="noopener noreferrer">gist</a></li><li>Run <code>yarn ios</code>, <code>yarn android</code> and <code>yarn web</code> to see it in action! 🎇</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="styling-for-home-component">Styling for Home component<a href="#styling-for-home-component" class="hash-link" aria-label="Direct link to Styling for Home component" title="Direct link to Styling for Home component">​</a></h3><p>You should notice that our <code>Home</code> doesn’t look good in term of UI. Let’s add styling for it.</p><ol><li>Inside <code>Components</code>, create <code>Shared.style.js</code> file <a href="https://gist.github.com/haruelrovix/7fee3c03b9fead9b74739e28a24effa9" target="_blank" rel="noopener noreferrer">gist</a></li><li>Import the style and update <code>Home</code> component as below <a href="https://gist.github.com/haruelrovix/4fb2e695d1562ff3475ebc91e6c27fcd" target="_blank" rel="noopener noreferrer">gist</a></li><li>Looks better now<!-- -->*<!-- -->, commit for adding Home component: <a href="https://github.com/haruelrovix/gitphone/commit/2e510c462c68d7c68433f2706cf8fbb847d6541e" target="_blank" rel="noopener noreferrer">2e510c4</a>.</li></ol><p><em>Wait a minute…</em> <!-- -->*<!-- -->Seems there is a problem with RNVI on the web version. You can check this <a href="https://github.com/oblador/react-native-vector-icons#web-with-webpack" target="_blank" rel="noopener noreferrer">Web (with webpack)</a> article or just following steps bellow.</p><ol><li>Open <code>config/webpack.config.dev.js</code></li><li>Add url-loader on line 162 <a href="https://gist.github.com/haruelrovix/edd520f4bf4268e17ef56f40314080a5" target="_blank" rel="noopener noreferrer">gist</a></li><li>Do the same for <code>config/webpack.config.prod.js</code> as well 👌</li><li>Open <code>src/index.js</code> file</li><li>Add <code>iconFont</code> and append <code>style</code> to document’s head <a href="https://gist.github.com/haruelrovix/b291e8a4f34577d94e85570d304b82fe" target="_blank" rel="noopener noreferrer">gist</a></li></ol><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/2584/1*YS7jioDKIKKvort5AzGXYA.png" alt="Our RNE x RNW progress so far~" class="img_ev3q"><em>Our RNE x RNW progress so far~</em></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="5️⃣-routing">5️⃣ Routing<a href="#5️⃣-routing" class="hash-link" aria-label="Direct link to 5️⃣ Routing" title="Direct link to 5️⃣ Routing">​</a></h2><p>Next, let’s add second component: <code>CommitList</code>.</p><ol><li>Create new folder inside <code>Components</code> named <code>Commit</code></li><li>Add new file: <code>CommitList.js</code> <a href="https://gist.github.com/haruelrovix/4cece6275cf40d97defb036756bab82b" target="_blank" rel="noopener noreferrer">gist</a></li></ol><p>On our app, user goes to second screen by click on <code>Submit</code> button. How do we implement it?</p><p><em>“react-router comes to the rescue”</em> - <a href="https://reacttraining.com/react-router/" target="_blank" rel="noopener noreferrer">https://reacttraining.com/react-router/</a></p><p>Add react-router-dom and react-router-native</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn add react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">router</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">dom react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">router</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Web needs <code>BrowserRouter</code> while native <code>NativeRouter</code>. We need to separate it based on the platform.</p><ol><li>On <code>src</code>, create <code>Utils</code> folder</li><li>Add two files on <code>Utils</code>: <code>Routing.native.js</code> and <code>Routing.web.js</code> <a href="https://gist.github.com/haruelrovix/3d7e26df6bb2d6056e2f4612a77fd2fc" target="_blank" rel="noopener noreferrer">gist</a></li></ol><p>Those file’s content differ only on the second line. <a href="https://gist.github.com/haruelrovix/32353543e417373a770365f855701c37" target="_blank" rel="noopener noreferrer">gist</a></p><p>Now, glue it together.</p><ol><li><p>Open <code>App.js</code>, import <code>CommitList</code> component</p></li><li><p>Import <code>Route</code>, <code>Router</code> and <code>Switch</code> from <code>Utils/Routing</code></p></li><li><p>Implement routing inside <code>render</code> method <a href="https://gist.github.com/haruelrovix/d5bf357efbbf094b26549f40709ec74f" target="_blank" rel="noopener noreferrer">gist</a></p></li><li><p>Now for the action on <code>Submit</code> button, open <code>Home.js</code></p></li><li><p>Import <code>withRouter</code> from <code>Utils/Routing</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> withRouter </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'../Utils/Routing'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p><code>WithRouter</code> is an HOC. Use it to wrap <code>Home</code> component</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">export</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">default</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">withRouter</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">Home</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Add <code>onPress</code> property for the button</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">onPress</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">onPressButton</span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Implement the <code>onPressButton</code> event handler</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function-variable function" style="color:#d73a49">onPressButton</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">history</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">push</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">'/commit'</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>All <code>Home</code> together <a href="https://gist.github.com/haruelrovix/8fc8ae9dab580c5e79f24a59a2c195b6" target="_blank" rel="noopener noreferrer">gist</a> | <a href="https://github.com/haruelrovix/gitphone/commit/f193aa3c268e7be263ae529de0f719ffd443e26d" target="_blank" rel="noopener noreferrer">commit</a></p></li></ol><p>Test it on <code>web</code> and <code>android</code>, you should be able to go back and forth between screens using <code>Submit</code> and pressing <code>Back</code> button.</p><p><em>“How can I go back on iOS?”</em> 😂</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="implement-withheader">Implement withHeader<a href="#implement-withheader" class="hash-link" aria-label="Direct link to Implement withHeader" title="Direct link to Implement withHeader">​</a></h3><p>We will create a <code>withHeader</code> HOC. Why HOC? We can reuse it easier <em>if we add more screens later.</em></p><ol><li><p>On <code>src</code>, create <code>HOCs</code> folder</p></li><li><p>Add <code>withHeader.js</code> file</p></li><li><p>Import <code>Header</code> from RNE and <code>Icon</code> from <code>RNVI/FontAwesome</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> Header </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'react-native-elements'</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> Icon </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'react-native-vector-icons/FontAwesome'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p><code>withHeader</code> accepts one prop: <code>title</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> withHeader </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> title </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">''</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">WrappedComponent</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Event handler to go back / go home</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function-variable function" style="color:#d73a49">goBack</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">history</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">goBack</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function-variable function" style="color:#d73a49">goHome</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">history</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">replace</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">'/'</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Import and use <code>withHeader</code> in <code>CommitList</code> component <a href="https://gist.github.com/haruelrovix/b1608f9f010caa47c18ebc71d87106ae" target="_blank" rel="noopener noreferrer">gist</a> | <a href="https://github.com/haruelrovix/gitphone/commit/0cf995bde91f5958e252188f1343de923069e7f3" target="_blank" rel="noopener noreferrer">commit</a></p></li></ol><h2 class="anchor anchorWithStickyNavbar_LWe7" id="6️⃣-fetch-data-from-github-api">6️⃣ Fetch data from GitHub API<a href="#6️⃣-fetch-data-from-github-api" class="hash-link" aria-label="Direct link to 6️⃣ Fetch data from GitHub API" title="Direct link to 6️⃣ Fetch data from GitHub API">​</a></h2><p>Let’s fetch a real-live data: list commit on repository by <a href="https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository" target="_blank" rel="noopener noreferrer">GitHub</a> and render it on our second screen, <code>CommitList</code>.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token constant" style="color:#36acaa">GET</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">/</span><span class="token plain">repos</span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">:</span><span class="token plain">owner</span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">:</span><span class="token plain">repo</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">commits</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Ideally, the :owner and :repo are form values from our first screen. Since the objective of this article is RNE x RNW, talk about that form (and state-management) later on.</p><p>To fetch GitHub API, we will use <a href="https://github.com/esphen/fetch-hoc" target="_blank" rel="noopener noreferrer">fetch-hoc</a> package and also need <a href="https://redux.js.org/api/compose" target="_blank" rel="noopener noreferrer">compose</a> from <code>redux</code>, to handle multiple HOCs on the same component.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn add fetch</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">hoc redux</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ol><li><p>Open <code>CommitList.js</code></p></li><li><p>Import <code>{ compose }</code> from <code>redux</code> and <code>fetch</code> from <code>fetch-hoc</code></p></li><li><p>Use it as below <a href="https://gist.github.com/haruelrovix/1c3affbfd585c3b8acfc1c156164fd1f" target="_blank" rel="noopener noreferrer">gist</a> | <a href="https://github.com/haruelrovix/gitphone/commit/334197c7c05bd1bdb1b648ca56cfe69c8b496eed" target="_blank" rel="noopener noreferrer">commit</a></p></li></ol><p>Now run <code>yarn web</code>, open <code>network</code> tab of <code>DevTools</code> and click <code>Submit</code> button, you’ll see bunch of commit data. By default GitHub API returning 30 commits.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="render-commit-data">Render commit data<a href="#render-commit-data" class="hash-link" aria-label="Direct link to Render commit data" title="Direct link to Render commit data">​</a></h3><p>Commit data that will be displayed on the screen:</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">author</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">avatar_url</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">commit</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  author</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">name</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  message</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Let’s modify <code>CommitList.js</code></p><ol><li><p>Add new imports</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> ActivityIndicator</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> Dimensions</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> FlatList</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> Platform</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> View </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'react-native'</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> Avatar</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> ListItem </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'react-native-elements'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>On main render, modify it as below</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">View style</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">styles</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">container</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">renderContent</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">View</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Create <code>renderContent</code> method</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function-variable function" style="color:#d73a49">renderContent</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">loading </span><span class="token operator" style="color:#393A34">?</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">ActivityIndicator color</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">'#87ceeb'</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">FlatList</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      keyExtractor</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">keyExtractor</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      data</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">data</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      renderItem</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">renderItem</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Create <code>renderItem</code> method</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function-variable function" style="color:#d73a49">renderItem</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> item </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">ListItem</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    title</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">item</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">commit</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">author</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">name</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    subtitle</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">item</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">commit</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">message</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    leftElement</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">renderLeftElement</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">item</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Create <code>renderLeftElement</code> method</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function-variable function" style="color:#d73a49">renderLeftElement</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">item</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">View</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Avatar</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      source</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> uri</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> item</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">author</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">avatar_url </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      size</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">'medium'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      rounded</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">View</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Here is our new <code>CommitList</code> including the styling to make it prettier <a href="https://gist.github.com/haruelrovix/e4b02328766efd1491338d5111becff7" target="_blank" rel="noopener noreferrer">gist</a> | <a href="https://github.com/haruelrovix/gitphone/commit/27a78672958f0caaa34b3e93c934685b9dcebd50" target="_blank" rel="noopener noreferrer">commit</a></p></li></ol><p><strong>Here they are!</strong></p><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/6436/1*iD3lSG6D3lGDkJr5HB2i2A.png" alt="awesome, eh?" class="img_ev3q"><em>awesome, eh?</em></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="7️⃣-handle-form-submission">7️⃣ Handle form submission<a href="#7️⃣-handle-form-submission" class="hash-link" aria-label="Direct link to 7️⃣ Handle form submission" title="Direct link to 7️⃣ Handle form submission">​</a></h2><p>Our app looks great so far. But we are not passing values from first to second screen. Let’s do it.</p><ol><li><p>To handle form, we’ll use <a href="https://github.com/jaredpalmer/formik" target="_blank" rel="noopener noreferrer">formik</a></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ yarn add formik</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Open <code>Home.js</code> and import it</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> Formik </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'formik'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Wrap main <code>View</code> with <code>formik</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Formik initialValues</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> owner</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">''</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> repo</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">''</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  onSubmit</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">onPressButton</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> handleChange</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> handleSubmit</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> values </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">View style</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">styles</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">container</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Add <code>onChangeText</code> handler to the <code>Input</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Input </span><span class="token operator" style="color:#393A34">...</span><span class="token plain"> onChangeText</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token function" style="color:#d73a49">handleChange</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">'owner'</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> value</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">values</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">owner</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Input </span><span class="token operator" style="color:#393A34">...</span><span class="token plain"> onChangeText</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token function" style="color:#d73a49">handleChange</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">'repo'</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> value</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">values</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">repo</span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Change <code>Button</code> <code>onPress</code> props to <code>handleSubmit</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Button </span><span class="token operator" style="color:#393A34">...</span><span class="token plain"> onPress</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">handleSubmit</span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Don’t forget to close the main <code>View</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">View</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Formik</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ol><p>Form submission: done 👌 Next question: How do we pass these values to second screen? <em>Send them when we redirect to second screen!</em></p><ol><li><p>Inside <code>onPressButton</code> method, send an object instead of <code>pathname</code> only.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">history</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">push</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  pathname</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'/commit'</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  state</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> owner</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> repo </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Open <code>CommitList</code>, import <code>withRouter</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> withRouter </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'../../Utils/Routing'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Add <code>withRouter</code> inside <code>compose</code></p></li><li><p>Get the values passed down to <code>withRouter</code> and use it to <code>fetch</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function" style="color:#d73a49">withHeader</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> title</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'Commits'</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">withRouter</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token function" style="color:#d73a49">fetch</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> location</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> state </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> </span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">https://api.github.com/repos/</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">state</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation">owner</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string string" style="color:#e3116c">/</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">state</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation">repo</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string string" style="color:#e3116c">/commits</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ol><p>HOC’s order does matter. So, make sure it the same as snippet above. In case you lost, here is the commit: <a href="https://github.com/haruelrovix/gitphone/commit/1d83c5e1487d2d99c00cc1b18f563ed4497d87b9" target="_blank" rel="noopener noreferrer">1d83c5e</a>.</p><p>Test the app. Now we should able to fetch any GitHub repository, <em>with some caveats.</em> 👀</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="8️⃣-polishing-the-app">8️⃣ Polishing the app<a href="#8️⃣-polishing-the-app" class="hash-link" aria-label="Direct link to 8️⃣ Polishing the app" title="Direct link to 8️⃣ Polishing the app">​</a></h2><p>What happens if we fetch repository which doesn’t exist? <em>Red screen on native, blank screen on web!</em> 😹</p><p><code>fetch-hoc</code> returns an error if it has. Let’s use it.</p><ol><li><p>On <code>CommitList</code>, modify <code>renderContent</code></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">loading </span><span class="token operator" style="color:#393A34">?</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">ActivityIndicator color</span><span class="token operator" style="color:#393A34">=</span><span class="token string" style="color:#e3116c">'#87ceeb'</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">renderFlatList</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Import <code>Text</code> from RNE</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">import</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">...</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> Text </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'react-native-elements'</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p>Add <code>renderFlatList</code> method</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">error </span><span class="token operator" style="color:#393A34">?</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Text h4</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain">Error</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token keyword" style="color:#00009f">this</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">data</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">message </span><span class="token operator" style="color:#393A34">||</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'😕'</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&lt;</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Text</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">FlatList </span><span class="token operator" style="color:#393A34">...</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ol><p>Test it. Instead of <em>red or blank</em> screen, now <code>Error: Not Found</code> displayed.</p><p>What’s else? Try to fetch <code>facebook/react-native</code>. We got another error 🙀</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">Cannot read property </span><span class="token string" style="color:#e3116c">'avatar_url'</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">of</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">null</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Not all of <code>author</code> have <code>avatar_url</code>. We should do this for the Avatar <code>source</code>.</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">source</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">uri</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">item</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">author </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> item</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">author</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">avatar_url</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">||</span><span class="token plain"> </span><span class="token keyword" style="color:#00009f">undefined</span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>So, our app renders nothing if it has no url? It doesn’t look good. <em>Solution: render author initial name.</em></p><p>With the help of RegEx and Avatar <code>title</code> props, <code>renderLeftElement</code> should look like this now:</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token function-variable function" style="color:#d73a49">renderLeftElement</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">item</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> initials </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> item</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">commit</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">author</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">name</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">match</span><span class="token punctuation" style="color:#393A34">(</span><span class="token regex regex-delimiter" style="color:#36acaa">/</span><span class="token regex regex-source language-regex" style="color:#36acaa">\b\w</span><span class="token regex regex-delimiter" style="color:#36acaa">/</span><span class="token regex regex-flags" style="color:#36acaa">g</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">||</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">return</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">View style</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain">leftElementStyle</span><span class="token punctuation" style="color:#393A34">}</span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token operator" style="color:#393A34">&lt;</span><span class="token plain">Avatar</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        title</span><span class="token operator" style="color:#393A34">=</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">initials</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">shift</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">||</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">''</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">+</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">initials</span><span class="token punctuation" style="color:#393A34">.</span><span class="token function" style="color:#d73a49">pop</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">||</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">''</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token operator" style="color:#393A34">...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Commit for Polishing the app section: <a href="https://github.com/haruelrovix/gitphone/commit/943974b285635884dc3ec1d7981146307dfd98d3" target="_blank" rel="noopener noreferrer">943974b</a>.</p><p>When I wrote this, fetch <code>facebook/react-native</code> returning following:</p><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/3812/1*OYTvJP0RLLQemyT0ukb1Iw.png" alt="Why no love for regex? Thanks to [Sanoor](https://stackoverflow.com/a/33076482)." class="img_ev3q"><em>Why no love for regex? Thanks to <a href="https://stackoverflow.com/a/33076482" target="_blank" rel="noopener noreferrer">Sanoor</a>.</em></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h2><p>We have created a simple app using RNE + RNW 👏</p><ul><li><p>Works great on iOS, web and android? ✅</p></li><li><p>Use components from react-native-elements? ✅</p></li><li><p>Move between screens? ✅</p></li><li><p>API calls? ✅</p></li></ul><p>Some improvements for <code>gitphone</code>:</p><p>If you go back from <code>Commits</code> screen, input form on <code>Home</code> screen are empty. If you want preserve previous values, this can be fixed easily by introducing redux to the app. References here: <a href="https://github.com/haruelrovix/rnw-github/pull/1/commits/48108ddc3e80669b9d57b2f998a5073d5e5eabb0" target="_blank" rel="noopener noreferrer">48108dd</a>.</p><p>Can we fetch more commits data once we reach the most bottom of the list? Infinite scroll?</p><p>For web, we can use <a href="https://github.com/joshwnj/react-visibility-sensor" target="_blank" rel="noopener noreferrer">react-visibility-sensor</a>. Check it out: <a href="https://github.com/haruelrovix/rnw-github/pull/1/commits/6c1f6894d78840648a11bbdf2d0e841fb6dad12d" target="_blank" rel="noopener noreferrer">6c1f689</a>.</p><p>For native, it’s easier. We can use <code>FlatList</code> <code>onEndReached</code> props. To give you an idea how, see this: <a href="https://github.com/haruelrovix/rnw-github/pull/2/commits/9d2e1f2a3e8605f8184f1f8950eb0175045bb67a" target="_blank" rel="noopener noreferrer">9d2e1f2</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="troubleshooting-">Troubleshooting 💺<a href="#troubleshooting-" class="hash-link" aria-label="Direct link to Troubleshooting 💺" title="Direct link to Troubleshooting 💺">​</a></h2><p><strong>#1</strong> <strong>Build failed when running <code>yarn android</code></strong></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">:</span><span class="token plain">app</span><span class="token operator" style="color:#393A34">:</span><span class="token plain">compileDebugAidl </span><span class="token constant" style="color:#36acaa">FAILED</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token constant" style="color:#36acaa">FAILURE</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> Build failed </span><span class="token keyword" style="color:#00009f">with</span><span class="token plain"> an exception</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> What went wrong</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Execution failed </span><span class="token keyword" style="color:#00009f">for</span><span class="token plain"> task </span><span class="token string" style="color:#e3116c">':app:compileDebugAidl'</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">&gt;</span><span class="token plain"> java</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">lang</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">IllegalStateException</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> aidl </span><span class="token keyword" style="color:#00009f">is</span><span class="token plain"> missing</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token operator" style="color:#393A34">*</span><span class="token plain"> Try</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">Run </span><span class="token keyword" style="color:#00009f">with</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">--</span><span class="token plain">stacktrace option to </span><span class="token keyword" style="color:#00009f">get</span><span class="token plain"> the stack trace</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"> Run </span><span class="token keyword" style="color:#00009f">with</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">--</span><span class="token plain">info or </span><span class="token operator" style="color:#393A34">--</span><span class="token plain">debug option to </span><span class="token keyword" style="color:#00009f">get</span><span class="token plain"> more log output</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token constant" style="color:#36acaa">BUILD</span><span class="token plain"> </span><span class="token constant" style="color:#36acaa">FAILED</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Here is how to fix #1:</p><ol><li>Open Android Studio.</li></ol><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/2000/1*GJ4GJ5KKimpr7MZP4R2yPA.png" class="img_ev3q"></p><ol start="2"><li>Open <code>android</code> project under <code>gitphone</code>.</li></ol><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/2000/1*jyLo3Jk-nudieT3aaEzUBQ.png" class="img_ev3q"></p><ol start="3"><li>Click Update on this prompt.</li></ol><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/2000/1*7I2tqGZ9C63aUGOtae-XHg.png" class="img_ev3q"></p><p>Wait for Android Studio syncing the project.</p><ol start="4"><li>It synced successfully with two errors.</li></ol><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/2558/1*GUlICoUm4cU4KzUfps3W0Q.png" class="img_ev3q"></p><ol start="5"><li><p>At this stage, just click <code>Update Build Tools version and sync project</code> on the sync window.</p></li><li><p>Now, the remaining warning is the <code>Configuration 'compile'...</code></p></li><li><p>To fix that, open <code>app/build.gradle</code> file, change <code>dependencies</code> section (line 139) to use <code>implementation</code> instead of <code>compile</code>.</p><p>dependencies {
implementation fileTree(dir: "libs", include: <!-- -->["*.jar"]<!-- -->)
implementation "com.android.support:appcompat-v7:23.0.1"
implementation "com.facebook.react:react-native:+"
}</p></li><li><p>Sync it again and close Android Studio.</p></li></ol><p><img loading="lazy" src="https://cdn-images-1.medium.com/max/2000/1*lIP2u1_7NmTmy8mcri6Smw.png" class="img_ev3q"></p><p>Troubleshooting for android is done. Now, you should be able to run <code>yarn android</code> successfully.</p><p><strong>#2 Build failed when running <code>yarn ios</code></strong></p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token operator" style="color:#393A34">**</span><span class="token plain"> </span><span class="token constant" style="color:#36acaa">BUILD</span><span class="token plain"> </span><span class="token constant" style="color:#36acaa">FAILED</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">**</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">The following build commands failed</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> CompileC </span><span class="token operator" style="color:#393A34">/</span><span class="token plain">gitphone</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">ios</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Intermediates</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">noindex</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">React</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Debug</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">iphonesimulator</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">double</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">conversion</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Objects</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">normal</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">x86_64</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">strtod</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">o </span><span class="token operator" style="color:#393A34">/</span><span class="token plain">gitphone</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">node_modules</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">third</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">party</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">double</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">conversion</span><span class="token operator" style="color:#393A34">-</span><span class="token number" style="color:#36acaa">1.1</span><span class="token number" style="color:#36acaa">.5</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">src</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">strtod</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">cc normal x86_64 c</span><span class="token operator" style="color:#393A34">++</span><span class="token plain"> com</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">apple</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">compilers</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">llvm</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">clang</span><span class="token punctuation" style="color:#393A34">.</span><span class="token number" style="color:#36acaa">1_0</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">compiler</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Here is how to fix #2:</p><p>Inside the project, run script below from your favourite terminal</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ curl </span><span class="token operator" style="color:#393A34">-</span><span class="token constant" style="color:#36acaa">L</span><span class="token plain"> https</span><span class="token operator" style="color:#393A34">:</span><span class="token operator" style="color:#393A34">/</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">gist</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">githubusercontent</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">com</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">fiznool</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">739b8e592596b5731512edfd77a1a2e9</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">raw</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">e0123e0b2382e127f1cfd6e28228315f1299738f</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">fix</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">rn</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">xcode10</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">sh </span><span class="token operator" style="color:#393A34">|</span><span class="token plain"> bash</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you run <code>yarn ios</code> again, and you got this error</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">The following build commands failed</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"> Libtool </span><span class="token operator" style="color:#393A34">/</span><span class="token plain">gitphone</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">ios</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Products</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Debug</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">iphonesimulator</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">libRCTWebSocket</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">a normal </span><span class="token function" style="color:#d73a49">x86_64</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">(</span><span class="token number" style="color:#36acaa">1</span><span class="token plain"> failure</span><span class="token punctuation" style="color:#393A34">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Please run this script:</p><div class="language-typescript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">$ cp ios</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Build</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Products</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Debug</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">iphonesimulator</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">libfishhook</span><span class="token punctuation" style="color:#393A34">.</span><span class="token plain">a node_modules</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">react</span><span class="token operator" style="color:#393A34">-</span><span class="token plain">native</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">Libraries</span><span class="token operator" style="color:#393A34">/</span><span class="token plain">WebSocket</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Troubleshooting for iOS is done. Now, you should be able to run <code>yarn ios</code> successfully.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="authors">Authors<a href="#authors" class="hash-link" aria-label="Direct link to Authors" title="Direct link to Authors">​</a></h3><ul><li><a href="https://github.com/haruelrovix" target="_blank" rel="noopener noreferrer">haruelrovix</a></li><li><a href="https://github.com/andangrd" target="_blank" rel="noopener noreferrer">andangrd</a></li></ul>]]></content:encoded>
        </item>
    </channel>
</rss>