<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kakul Gupta on Medium]]></title>
        <description><![CDATA[Stories by Kakul Gupta on Medium]]></description>
        <link>https://medium.com/@kakul.gupta009?source=rss-c4558324320d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HAifG-pXVnUssLtU.</url>
            <title>Stories by Kakul Gupta on Medium</title>
            <link>https://medium.com/@kakul.gupta009?source=rss-c4558324320d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:15:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kakul.gupta009/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Custom drawer using React Navigation]]></title>
            <link>https://codeburst.io/custom-drawer-using-react-navigation-80abbab489f7?source=rss-c4558324320d------2</link>
            <guid isPermaLink="false">https://medium.com/p/80abbab489f7</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-navigation]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Kakul Gupta]]></dc:creator>
            <pubDate>Sun, 24 Sep 2017 08:23:38 GMT</pubDate>
            <atom:updated>2017-10-10T17:58:57.914Z</atom:updated>
            <content:encoded><![CDATA[<p>Configuring your app side menu in a React Native App</p><p>React Navigation is a powerful library that helps us create Stack navigation, Drawer navigation and Tab navigation in our React Native apps. To create a simple side menu all we need to do is create a <strong>DrawerNavigator</strong> and pass in the route configuration and drawer configuration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c297545fab2934a8e23d96eb39444dd/href">https://medium.com/media/2c297545fab2934a8e23d96eb39444dd/href</a></iframe><p>The above code is the <strong>entry level</strong> component in my react native app. The routing in the app happens via the <strong><em>Router</em></strong> component which is defined as below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a8f3263e3492756c44839240a53b583/href">https://medium.com/media/0a8f3263e3492756c44839240a53b583/href</a></iframe><p>This gives us a drawer navigator with a list of navigation items. The component essentially contains the DrawerNavigator from react-navigation. When rendered it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*goXSiIFxP6q75UtSqxJsgg.png" /></figure><p>However, this out of the box method does not give us many options to configure the menu items. While working on my project, I searched through the documentation and spent hours trying to figure out how to create nested menus or perform functions other than navigation. After much effort this is what I found.</p><p>React-Navigation provides us with <strong>contentComponent </strong>configuration option in the <strong>DrawerNavigatorConfig</strong>. The <strong>contentComponent</strong> option allows us to pass in our own custom component to render in the drawer.</p><p>For limited customisation we can use <strong>DrawerItems </strong>component provided by react-navigation in <strong>contentComponent</strong>. In case we want to update the styles of the drawer, make it scrollable or add a header/footer we can still achieve it by using the <strong>DrawerItems</strong>. It will handle the navigation on its own. Below is an example of how to achieve it.</p><pre>export default DrawerNavigator({<br>  // ... your screens<br>}, {<br>  // define customComponent here<br>  contentComponent: props =&gt; <br>  &lt;ScrollView&gt;<br>    &lt;DrawerItems {...props} /&gt;<br>    &lt;Text&gt;Your Own Footer Area After&lt;/Text&gt;<br>  &lt;/ScrollView&gt;<br>});</pre><p>Complete customisation using contentComponent with Navigation actions to can be done in the following way:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a19ce1888dd9bf6f0deda8e2fd3a65d1/href">https://medium.com/media/a19ce1888dd9bf6f0deda8e2fd3a65d1/href</a></iframe><p>The SideMenu is my custom component to be rendered in place of the default DrawerItems provided by the library. Inside the SideMenu:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cb577f220909b88315348f040f0766a/href">https://medium.com/media/2cb577f220909b88315348f040f0766a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*aklGgQPyun1z4Shxpro-9g.png" /></figure><p>The above example now allows me to create my own onPress functionality or add collapsible menu items as needed.</p><p>For sample app code check out: <a href="https://github.com/kakulgupta/CustomDrawer"><strong>https://github.com/kakulgupta/CustomDrawer</strong></a></p><p>That’s all folks!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hYlGt9rbEInNbUsA9ExBaw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80abbab489f7" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/custom-drawer-using-react-navigation-80abbab489f7">Custom drawer using React Navigation</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>