<?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 Feargal Walsh on Medium]]></title>
        <description><![CDATA[Stories by Feargal Walsh on Medium]]></description>
        <link>https://medium.com/@feargalwalsh?source=rss-41831c2598ee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1UsgzA4_lbwOVjWP.</url>
            <title>Stories by Feargal Walsh on Medium</title>
            <link>https://medium.com/@feargalwalsh?source=rss-41831c2598ee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:18:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@feargalwalsh/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[Defeating ClassPass: Using community to turn fitness into a value sale]]></title>
            <link>https://feargalwalsh.medium.com/defeating-classpass-using-community-to-turn-fitness-into-a-value-sale-84f2cbd2490f?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/84f2cbd2490f</guid>
            <category><![CDATA[fitness]]></category>
            <category><![CDATA[classpass]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Wed, 15 Nov 2023 05:27:49 GMT</pubDate>
            <atom:updated>2023-11-15T05:27:49.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*xvBS-ZbWaG1LCbBv" /></figure><p>Boutique fitness studios are facing a crisis. ClassPass has disrupted the industry in recent years by undercutting prices and offering patrons a more flexible arrangement than a traditional fitness studio. The platform is beloved by it’s users, but often not by the studios.</p><p>ClassPass’ business model relies on studios having trouble filling classes. They offer to sell extra spots at a discount, without the studio lifting a finger. Their main selling point is that they’ll act as an inbound sales funnel for new members. However, ClassPass are not in the business of enticing customers off their platform. And don’t have any in built tooling to motivate users to convert to full members. In fact their platform is strategically designed to keep users perpetually hopping from studio to studio, especially in densely populated urban environments, the options are abundant. From the user’s perspective, it’s a no-brainer to avoid committing to one studio. The data backs this up, with a conversion rate of under 2% from ClassPass users to full studio members.</p><p>There is also dissatisfaction amongst studio owners about the type of clientele that ClassPass supply to the studios. There is a saying:</p><p>“The client who pays the least, complains the most”</p><p>This is no different in the case of most ClassPass users. They are bargain hunters by definition and tend to take up the majority of the customer service and trainers bandwidth. Because they are often the type of people who see businesses as a purely transactional space. However, boutique fitness studios are small by design which fosters personal connection amongst the community it builds amongst it’s members and trainers alike. ClassPass users torpedo this by attending once and distracting the staff from the people who are most important to business. As a ClassPass user for years, I witnessed all of this first hand, but finally came around to joining one studio full time.</p><p>The studio that changed my perspective on ClassPass was BoxFit in San Diego. I was attracted to it because the owner, Mike Reeder, had created a strong sense of community that I had rarely found elsewhere. The pricing structure appealed to my thrifty side, allowing me to try it out before committing. The introductory month was $49, and the subsequent month was also discounted at around $85. It was only on the third month that I paid the full price of $139, which felt reasonable by that point. The workouts were excellent, and the people attending were friendly, open, and supportive. I believe all of this was intentional on Mike’s part. He has created a gym that fosters a social and connected experience, something that ClassPass could never provide me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84f2cbd2490f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing multiple npm versions with ease]]></title>
            <link>https://feargalwalsh.medium.com/managing-multiple-npm-versions-locally-with-ease-ad2f7757bc1c?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad2f7757bc1c</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[npm-version]]></category>
            <category><![CDATA[nvm]]></category>
            <category><![CDATA[node]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Wed, 29 Dec 2021 01:03:02 GMT</pubDate>
            <atom:updated>2021-12-29T01:05:13.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hwe9ZofFXOuaak9LqjH9rg.jpeg" /></figure><h3>Background</h3><p>Are you frustrated with installing a new npm version globally every time you need to switch due to a different project using a different version?. <a href="https://github.com/nvm-sh/nvm">nvm</a> is commonly used to manage node versions. However, the associated npm version that the application will use is determined by whichever npmversion is installed globally.</p><h3>Steps</h3><ol><li>First, install nvm, which is outlined <a href="https://github.com/nvm-sh/nvm#installing-and-updating">here</a>.</li><li>Then, install the particular version of node that is required by the repository, this is specified in the “engines” object in the package.json of a repository, for example:</li></ol><pre>&quot;engines&quot;: {</pre><pre>  &quot;node&quot;: &quot;&lt;version&gt;&quot;,</pre><pre>  &quot;npm&quot;: &quot;&lt;version&gt;&quot;</pre><pre>},</pre><p>These are the versions of node and npm, that the application expects when running npm commands in the directory. The command to do this in this case would be:</p><pre>nvm install &lt;version&gt;</pre><p>3. At this point the version of node that the application expects is installed. However in order to install a version of that’s associated with this version of node we <em>need</em> npm in the first place. This is a circular dependency problem which is easily solved by installing another version of node using nvm and globally installing npm to use for installation purposes.</p><pre>nvm install node //installs and uses the latest node<br>npm install -g npm@latest</pre><p>4. The next step is to install a specific version of npm for the version of node that is required by the repository, this is made possible by the fact that nvm essentially installs separate versions of node all in the .nvm directory that it switches between when the nvm usecommand is run. The process may vary slightly for different nvm setups in the root directory but it should be something like:</p><pre>cd ~/.nvm/versions/&lt;version&gt;/lib<br>// if node_modules exists<br>rm -rf node_modules // to remove current node version installed<br>// if package.json exists open it and edit it to the desired npm version, if not create one with<br>vi package.json</pre><p>Paste the following into the package.json file, specifying the desired version</p><pre>{<br>  &quot;dependencies&quot;: {<br>    &quot;npm&quot;: &quot;&lt;version&gt;&quot;<br>  }<br>}</pre><p>This part of the setup can also vary, at one point npm install was run but the npm version specified in the package.json did not correspond to the version installed. In any case running:</p><pre>npm install npm@&lt;version&gt;</pre><p>will install the desired npm version and associate it with the version of node that has been specified.</p><p>5. Profit, cd back out of the nvm directory and into the working repository. Simply run</p><pre>nvm use &lt;version&gt;</pre><p>and the statement returned from nvm verifies that the expected npm version is not installed alongside this node version.</p><pre>nvm use 14.17.0                                                            <br>Now using node v14.17.0 (npm v7.16.0)</pre><h3>Conclusion</h3><p>With these steps it’s no longer necessary to keep reinstalling a global version of npm each time you start working in a different directory with a different node version. A step further could be to figure out how to manage this directly from the .nvmrc file and to have this logic all handled without needing to run a single command.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad2f7757bc1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pragmatic Programmer Exercises]]></title>
            <link>https://feargalwalsh.medium.com/pragmatic-programmer-exercises-c5e555110e91?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5e555110e91</guid>
            <category><![CDATA[bnf]]></category>
            <category><![CDATA[context-free-grammar]]></category>
            <category><![CDATA[backus-naur-form]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Sun, 25 Oct 2020 18:21:40 GMT</pubDate>
            <atom:updated>2020-10-25T18:21:40.876Z</atom:updated>
            <content:encoded><![CDATA[<p>Pg. 63</p><p>Exercise 6</p><p>Design a BNF grammar to parse a time specification. All of the following examples should be accepted.</p><p>&lt;time&gt; ::= &lt;hour&gt; &lt;separator&gt; &lt;minute&gt; &lt;optional-am-pm-suffix&gt;</p><p>&lt;hour&gt; ::= &lt;first-hour-digit&gt; &lt;second-hour-digit&gt;</p><p>&lt;first-hour-digit&gt; ::= &lt;digit&gt;</p><p>&lt;second-hour-digit&gt; ::= 0 | 1 | 2</p><p>&lt;minute&gt; ::= &lt;first-second-digit&gt; &lt;digit&gt;</p><p>&lt;first-second-digit&gt; ::= 0| 1 | 2 | 3 | 4 | 5 | 6</p><p>&lt;optional-am-pm-suffix&gt; :: = &quot;am&quot; | &quot;pm&quot; | &quot;&quot;</p><p>&lt;separator&gt; ::= :</p><p>Please critique this. I’d like to deeply discuss this and explore the problem before looking at the answer 😃</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5e555110e91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Copying to the clipboard in React]]></title>
            <link>https://feargalwalsh.medium.com/copying-to-the-clipboard-in-react-81bb956963ec?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/81bb956963ec</guid>
            <category><![CDATA[clipboard]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Thu, 30 Apr 2020 16:06:30 GMT</pubDate>
            <atom:updated>2020-04-30T16:08:18.346Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cofce6zR3z5pgXVm" /></figure><h3>document.execCommand(‘copy’)</h3><p>This is the failsafe option that will work on <a href="https://caniuse.com/#feat=document-execcommand">every modern browser</a> document.execCommand(&#39;copy&#39;) is a method on the document object model.</p><p>The most common option. Around since the DOM(document object model) days.</p><p>It can be tricky to work with since you don’t pass a variable you need to select the value of the inputRef using inputRef.current.select .</p><p>There is no explicit variable assignment you can console.log or anything.</p><p>Although console.log(document.execCommand(&#39;copy&#39;)) does print true when the copy function works.</p><p>The text is read from the DOM and copied to the clipboard.</p><p>If you’re using react you need to use an input element, or will you get an error to the tune of select is non a function .</p><p>So, if you are using reusable components they may not inherit the properties of an input element. select is a function bound to input elements.</p><h3>Navigator.Clipboard api</h3><p>If you are dealing with more modern browsers the asynchronous Navigator.Clipboard api is an elegant option.</p><p>You will have much more control and visibility into your copy command. And you can pass a variable to your asynchronous function.</p><p>This means that you don’t need to worry about the type of element you’re copying from. As long as you can extract a value you can copy it to the clipboard.</p><p>This makes it simpler to copy an image to the clipboard for example.</p><p>If you want error states, loading states and valid confirmation that the text has been copied to the clipboard this is your function.</p><p>The only notable browser that’s not supported is Safari 13 for Desktop, the iOS app is supported.</p><p>With this in mind we can write a polyfill that checks if the Navigator.Clipboard api exists and if it does uses it.</p><p>If not it falls back to the document.execCommand(&#39;copy&#39;) command.</p><p>You can see an example of this in action in the CodePen below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F43osh&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F43osh&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F43osh%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/758a051d9d7108870b1f943fc24f1bb1/href">https://medium.com/media/758a051d9d7108870b1f943fc24f1bb1/href</a></iframe><h3><strong>Libraries</strong></h3><p>Using a library is not necessary for this task but if you’re in a time-crunch these are the most well recommended options online.<br><a href="https://www.npmjs.com/package/react-copy-to-clipboard">https://www.npmjs.com/package/react-copy-to-clipboard</a><br><a href="https://www.npmjs.com/package/react-clipboard.js">https://www.npmjs.com/package/react-clipboard.js</a></p><h3>Resources</h3><p><a href="https://caniuse.com/#search=Clipboard">https://caniuse.com/#search=Clipboard</a></p><p><a href="https://caniuse.com/#feat=clipboard">Can I use... Support tables for HTML5, CSS3, etc</a></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand">https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand</a></p><p><a href="https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript">https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81bb956963ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get started with React Native in lightning speed]]></title>
            <link>https://codeburst.io/get-started-with-react-native-in-lightning-speed-767187359d1c?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/767187359d1c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react-native-elements]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Thu, 10 May 2018 23:50:17 GMT</pubDate>
            <atom:updated>2018-06-05T05:16:57.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ms42grO2OsuYkNrx." /><figcaption>Photo by <a href="https://unsplash.com/photos/sE2ZK9KfTW8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">K</a> on <a href="https://unsplash.com/search/photos/lightning?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This FREE guide will get you off the ground.</p><p><a href="https://hackernoon.com/get-started-with-react-native-in-lightning-speed-d781701ec2a7">Part One</a> <a href="https://medium.com/@feargswalsh/get-started-with-react-native-in-lightning-speed-f9c3079c2597">Part Two</a></p><p>This week we’re going to get some data into our app that isn’t hardcoded. To do this we’re going to need to write a request and some other logic that makes this easier for the user to see what’s going on. The first step is to communicate to the user that their data is loading when the app first launches. To do this we can add a loading state parameter and call it in the constructor like so:</p><pre>constructor(props) {</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>isLoading: true,</pre><p>Then we add a spinner to our component that will only be activated when the isLoading state is true. which is what we initialize the app to.</p><p>Import ActivityIndicator into your project and in the render method for your Flatlist, define a variable spinner.</p><p>const spinner = &lt;ActivityIndicator size=’large’/&gt;</p><p>The next step is to write our query which, since this flatList is in the first thing that our app needs can be called in the componentDidMount lifecycle method.</p><pre>componentDidMount(){</pre><pre>return fetch(&#39;https://facebook.github.io/react-       native/movies.json&#39;)</pre><pre>.then((response) =&gt; response.json())</pre><pre>.then((responseJson) =&gt; {</pre><pre>this.setState({</pre><pre>isLoading: false,</pre><pre>dataSource: responseJson.movies,</pre><pre>}, function(){</pre><pre>});</pre><pre>})</pre><pre>.catch((error) =&gt;{</pre><pre>console.error(error);</pre><pre>});</pre><p>The query consists of the fetch api to GET the data which is returned as a promise. The data is then used to modify the state using this.setState and the data is then available to each ListItem in the FlatList. The result is that our list now has dynamically served data instead of hardcoded, Voilá!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*9gcSji5N7mRyq2SYK9b2jA.png" /></figure><p>To fix that overlapping padding at the top we simply add.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*b1rjoBkQZgdlw5n6bTxrjw.png" /></figure><p>&lt;View style = {{paddingTop: 20, flex: 1}}&gt;</p><p>I hope you learned something from this post. I’m heavily indebted to my resources as always. I could not have done this without them, oh and the code is <a href="http://here/">here</a>.</p><h4>Resources</h4><p><a href="https://www.raywenderlich.com/165140/react-native-tutorial-building-ios-android-apps-javascript">https://www.raywenderlich.com/165140/react-native-tutorial-building-ios-android-apps-javascript</a></p><p><a href="https://facebook.github.io/react-native/docs/network.html">https://facebook.github.io/react-native/docs/network.html</a></p><figure><a href="http://bit.ly/codeburst"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3hPOj27LTt0ZPn5TQuhZg.png" /></a></figure><blockquote>✉️ <em>Subscribe to </em>CodeBurst’s<em> once-weekly </em><a href="http://bit.ly/codeburst-email"><strong><em>Email Blast</em></strong></a><strong><em>, </em></strong>🐦 <em>Follow </em>CodeBurst<em> on </em><a href="http://bit.ly/codeburst-twitter"><strong><em>Twitter</em></strong></a><em>, view </em>🗺️ <a href="http://bit.ly/2018-web-dev-roadmap"><strong><em>The 2018 Web Developer Roadmap</em></strong></a><em>, and </em>🕸️ <a href="http://bit.ly/learn-web-dev-codeburst"><strong><em>Learn Full Stack Web Development</em></strong></a><em>.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=767187359d1c" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/get-started-with-react-native-in-lightning-speed-767187359d1c">Get started with React Native in lightning speed</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>
        <item>
            <title><![CDATA[Get started with React Native in lightning speed]]></title>
            <link>https://codeburst.io/get-started-with-react-native-in-lightning-speed-f9c3079c2597?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9c3079c2597</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Thu, 10 May 2018 23:45:52 GMT</pubDate>
            <atom:updated>2018-06-05T05:17:31.544Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6Mbr42EN2qXR3cis%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6Mbr42EN2qXR3cis%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3o6Mbr42EN2qXR3cis%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/71bc2950fd6f8701c129a3d1d0a4472c/href">https://medium.com/media/71bc2950fd6f8701c129a3d1d0a4472c/href</a></iframe><h3>Get started with React Native in lightning speed</h3><p>Check out part two of this FREE guide.</p><p>In case you missed <a href="https://hackernoon.com/get-started-with-react-native-in-lightning-speed-d781701ec2a7">part one</a>, you can catch up but if you’re even mildly experienced with React Native programmer it’s basically a paraphrasing of the <a href="https://facebook.github.io/react-native/docs/getting-started.html">getting started section</a> of the docs. So you don’t really need to go back to catch up.</p><p>This week we’re going to get something working on the screen, namely a scrollable list, of which we use alot of at <a href="https://itunes.apple.com/us/app/zonder/id1350039904?mt=8">Zonder</a>. This is a really useful component as it’s extremely flexible. After you run react-native run-ios your simulator should launch. If you get this error message, just close the packager and re-run react-native run-ios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*vzwDFXGNVzP4cp4B7i16JA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdA0J35GGgD9rgL6-Uj2gw.png" /></figure><p>As I mentioned last week your app should be loaded to 100% in the packager. If you encounter any issues where the app is hanging on the launch screen for too long. This is a good place to check for an error.</p><p>The library we will be using to make our flatlist is the <a href="https://github.com/react-native-training/react-native-elements">react-native-elements</a> library by <a href="https://medium.com/react-native-training">React Native Training</a>. To install run</p><p>npm install — save react-native-elements</p><p>If you run into the following error it can be debugged by running.</p><p>npm install — save react-native-vector-icons</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*pgrpBc6TfC_eIyPIOJrj9w.png" /></figure><p>Indeed, errors in this format are extremely common in React Native and I have never not gotten around them by simply running:</p><p>npm install --save missing-library-name</p><p>NB: missing-library-name is a placeholder for whatever library the error message is yelling at you about being missing is. If you get an error regarding Material icons being missing on iOS, you need to run:</p><p>react-native link react-native-vector-icons</p><p>I often need to run react-native-link after I install a library but the use of it seems arbitrary and the command is <a href="https://github.com/facebook/react-native/issues/15646">known to be unstable</a>, so I don’t recommend it unless a Google search of your error suggests it might help.</p><p>The next step is to simply copy and paste this code into your App.js</p><pre>/**</pre><pre>* Sample React Native App</pre><pre>* https://github.com/facebook/react-native</pre><pre>* @flow</pre><pre>*/</pre><pre>import React, { Component } from &#39;react&#39;;</pre><pre>import {</pre><pre>AppRegistry,</pre><pre>Platform,</pre><pre>StyleSheet,</pre><pre>Text,</pre><pre>View,</pre><pre>FlatList</pre><pre>} from &#39;react-native&#39;;</pre><pre>import { ListItem } from &#39;react-native-elements&#39;</pre><pre>export default class App extends Component {</pre><pre>constructor(props) {</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>data : [{</pre><pre>name: &#39;Amy Farha&#39;,</pre><pre>avatar_url: &#39;https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg&#39;,</pre><pre>subtitle: &#39;Vice President&#39;</pre><pre>},</pre><pre>{</pre><pre>name: &#39;Chris Jackson&#39;,</pre><pre>avatar_url: &#39;https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg&#39;,</pre><pre>subtitle: &#39;Vice Chairman&#39;</pre><pre>}]</pre><pre>}</pre><pre>}</pre><pre>keyExtractor = (item, index) =&gt; index</pre><pre>renderItem = ({ item }) =&gt; (</pre><pre>&lt;ListItem</pre><pre>title={item.name}</pre><pre>subtitle={item.subtitle}</pre><pre>avatar={{ source: { uri: item.avatar_url } }}</pre><pre>/&gt;</pre><pre>)</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;FlatList</pre><pre>keyExtractor={this.keyExtractor}</pre><pre>data={this.state.data}</pre><pre>renderItem={this.renderItem}</pre><pre>/&gt;</pre><pre>)</pre><pre>}</pre><pre>}</pre><pre>AppRegistry.registerComponent(&#39;AwesomeProject&#39;, () =&gt; App);</pre><pre>/**</pre><pre>* Sample React Native App</pre><pre>* https://github.com/facebook/react-native</pre><pre>* @flow</pre><pre>*/</pre><pre>import React, { Component } from &#39;react&#39;;</pre><pre>import {</pre><pre>AppRegistry,</pre><pre>Platform,</pre><pre>StyleSheet,</pre><pre>Text,</pre><pre>View,</pre><pre>FlatList</pre><pre>} from &#39;react-native&#39;;</pre><pre>import { ListItem } from &#39;react-native-elements&#39;</pre><pre>export default class App extends Component {</pre><pre>constructor(props) {</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>data : [{</pre><pre>name: &#39;Amy Farha&#39;,</pre><pre>avatar_url: &#39;https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg&#39;,</pre><pre>subtitle: &#39;Vice President&#39;</pre><pre>},</pre><pre>{</pre><pre>name: &#39;Chris Jackson&#39;,</pre><pre>avatar_url: &#39;https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg&#39;,</pre><pre>subtitle: &#39;Vice Chairman&#39;</pre><pre>}]</pre><pre>}</pre><pre>}</pre><pre>keyExtractor = (item, index) =&gt; index</pre><pre>renderItem = ({ item }) =&gt; (</pre><pre>&lt;ListItem</pre><pre>title={item.name}</pre><pre>subtitle={item.subtitle}</pre><pre>avatar={{ source: { uri: item.avatar_url } }}</pre><pre>/&gt;</pre><pre>)</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;FlatList</pre><pre>keyExtractor={this.keyExtractor}</pre><pre>data={this.state.data}</pre><pre>renderItem={this.renderItem}</pre><pre>/&gt;</pre><pre>)</pre><pre>}</pre><pre>}</pre><pre>AppRegistry.registerComponent(&#39;AwesomeProject&#39;, () =&gt; App);</pre><p>The app should work pretty much straight out of the box and render a list of your two users like so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*BsJrQQRfCvr79BIolgAsvw.png" /></figure><p>Note that I currently don’t have the avatar working. But I will update this once I do. The link is not broken, I checked. But I think that there may be some issues with how it is being read in through the component state. If you have any suggestions on what you would like to see me make the app do next, please don’t hesitate to reach out <a href="https://feargalwalsh.com/#contact">here</a> or in the comments. The code is available on Github <a href="https://github.com/feargswalsh92/LightningRN">here.</a></p><p>Thanks for your attention, it’s the most valuable thing you can give anyone. The hardest thing about writing these posts is often getting started, so any suggestions/requests for topics would be appreciated! I also welcome feedback on <a href="https://medium.com/me/stories/public">previous posts.</a></p><p>If you liked what you have read here and would like to hear more from me please feel free to sign up for my e-mail list on my personal site <a href="https://feargalwalsh.us17.list-manage.com/subscribe/post?u=de3b08e1cdd1bfe1557a056ab&amp;id=c5dad51e33">here</a>, or at the very least…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QqWj9KV-HAc4xPGUyw2eRQ.png" /><figcaption><a href="https://www.youtube.com/watch?v=DdCYMvaUcrA">https://www.youtube.com/watch?v=DdCYMvaUcrA</a></figcaption></figure><h4>Resources</h4><ul><li><a href="https://www.gq.com/story/jeb-bush-saddest-moments">The 15 Saddest Moments of Jeb Bush&#39;s Presidential Campaign</a></li><li><a href="https://react-native-training.github.io/react-native-elements/docs/listitem.html">ListItem · React Native Elements</a></li><li><a href="https://react-native-training.github.io/react-native-elements/docs/listitem.html">ListItem · React Native Elements</a></li><li><a href="https://github.com/react-native-training/react-native-elements/issues/503">ListItem：Unrecognized font family &#39;Material Icons&#39; · Issue #503 · react-native-training/react-native-elements</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9c3079c2597" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/get-started-with-react-native-in-lightning-speed-f9c3079c2597">Get started with React Native in lightning speed</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>
        <item>
            <title><![CDATA[Get started with React Native in lightning speed]]></title>
            <link>https://medium.com/hackernoon/get-started-with-react-native-in-lightning-speed-d781701ec2a7?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/d781701ec2a7</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[learn-to-code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[real-estate]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Fri, 27 Apr 2018 17:20:11 GMT</pubDate>
            <atom:updated>2019-04-25T07:15:45.006Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*j2Bff97buW_-IdrvoKi3Cg.png" /><figcaption>Image courtesy of <a href="https://unsplash.com/@dominik_qn">@dominik_qn</a> on @Unsplash</figcaption></figure><p>Check out this FREE guide.</p><p><a href="https://hackernoon.com/tagged/react-native">React Native</a> is the <a href="https://hackernoon.com/tagged/future">future</a>. This weekend at <a href="https://medium.com/u/9746fe9ecd5f">Zonder</a> we are launching our mobile app for iOS and Android and I have been blown away at the speed of development to get there. That is due in no small part to our amazing team but also to this phenomenal framework. Today we’re going to walk through a very introductory course that shows how you can get your app up and running in an afternoon.</p><p><a href="https://facebook.github.io/react-native/docs/getting-started.html">https://facebook.github.io/react-native/docs/getting-started.html</a></p><p>The react-native docs are the best place to get an overview of this process but I’ll be diving into more detail to make it even easier to get going.</p><p>// NB I am using macOS and iOS as my environments, the project that we build will still be an Android project but it will require some extra work to get started as outlined <a href="https://medium.com/@feargswalsh/how-to-get-your-react-native-app-working-on-android-c936faa52242">here</a>.</p><p>We will be following the “Building Projects with Native Code” tab as it is a better long-term solution if you want to build your app on a device or upload it to the app store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*eeGh-I0N0d3cmWjidKiNkQ.png" /><figcaption>Select building projects with native code tab</figcaption></figure><p>You can still do this with create-react-native-app but you will need to run npm run eject at some point which is irreversible and a little tricky so this is a better road to go down IMHO.</p><p>Firstly you’ll need to install or upgrade node( if you’re running &lt; V6).To check your node version run:</p><p>node -v</p><p>If node is missing or less than v6.0.0 run:</p><p>brew install node</p><p>If you are getting an error to the tune of “brew not recognized” or something to that effect, run this command to install it.</p><pre>/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</pre><p>And then install watchman too.</p><p>brew install watchman</p><p>The next step is to run:</p><p>npm install -g react-native-cli</p><p>which, surprise surprise, installs the react-native-cli, you will also need <a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">Xcode</a> and the most recent version of the command line tools installed.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FfWfF11oHQX6WF0493L%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Freact-native-cli-xcode-fWfF11oHQX6WF0493L&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FfWfF11oHQX6WF0493L%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="255" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba1515974ac9a2067f040cbf3ee7e939/href">https://medium.com/media/ba1515974ac9a2067f040cbf3ee7e939/href</a></iframe><h4>The fun bit</h4><p>Now that we have all of our foundations laid it’s time to launch our app. To do this create a project in a suitable directory.</p><p>react-native init AwesomeProject</p><p>cd AwesomeProject</p><p>and</p><p>react-native run-ios</p><p>This will launch a pretty lengthy build process, but don’t worry you won’t have to go through this every time you start a new project. The other thing to be aware of is that a launch packager will launch in a new terminal window, at some point after you run the above command. If you ever run into issues where your app is stuck on the loading screen this is a great place to look for errors that may be causing this.</p><p>Your app should be up and running and ready to build on top of, which we’ll be looking into next week.</p><p>Thanks for your attention, it’s the most valuable thing you can give anyone. The hardest thing about writing these posts is often getting started, so any suggestions/requests for topics would be appreciated! I also welcome feedback on <a href="https://medium.com/me/stories/public">previous posts.</a></p><p>If you liked what you have read here and would like to hear more from me please feel free to sign up for my e-mail list on my personal site <a href="https://feargalwalsh.us17.list-manage.com/subscribe/post?u=de3b08e1cdd1bfe1557a056ab&amp;id=c5dad51e33">here</a>, or at the very least…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QqWj9KV-HAc4xPGUyw2eRQ.png" /><figcaption><a href="https://www.youtube.com/watch?v=DdCYMvaUcrA">https://www.youtube.com/watch?v=DdCYMvaUcrA</a></figcaption></figure><h4>Resources</h4><p><a href="https://www.gq.com/story/jeb-bush-saddest-moments">The 15 Saddest Moments of Jeb Bush&#39;s Presidential Campaign</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d781701ec2a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/get-started-with-react-native-in-lightning-speed-d781701ec2a7">Get started with React Native in lightning speed</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What you need to know about JSON.]]></title>
            <link>https://feargalwalsh.medium.com/what-you-need-to-know-about-json-feae4e125d5d?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/feae4e125d5d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[back-end-developer]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 19:42:57 GMT</pubDate>
            <atom:updated>2018-04-19T19:42:57.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*YB5kQCYzAn5GTSN-X9iZsg.png" /><figcaption>TLDR, courtesy Douglas Crockford</figcaption></figure><p>If it fits on the back of a business card, this blog post shouldn’t be too long right?</p><p>I’m going to do my best to not give you that sinking feeling that I get sometimes when I click an attractive headline and start reading a promising intro only to scroll down and realise that the blog post goes on foreeeeeeever without really highlighting what you need to know. If there’s one thing you take from this article it should definitely by the great Douglas Crockford’s business card. But, naturally since it fits on a business card it could use a little more detail in parts.</p><h4>Value vs. Type</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/149/1*BHugEziRLc-vdsBfy2Y1Cg.png" /></figure><p>The word value is undoubtedly correct here. JavaScript is,by definition, weakly typed. However, I would argue that since these are all different types that the word type would be more appropriate here. Not to be nitpicky but also very clearly being nitpicky.</p><p>However since the other side of the business card is dedicated to breaking down what string and number could consist of, I think it’s fair to say that the types are well explained in such a small real estate. Seriously, I can’t speak highly enough of how impressed I am at Douglas’ (if I may call him that’s) ability to condense a relatively simple but still complex topic into such a digestible format. If more software documentation was written in this way I feel like we would all benefit hugely.</p><h4>JSON.parse() &amp;&amp; JSON.stringify()</h4><p>These are two methods in JSON that everybody needs to know. JSON objects are returned as strings from API calls. In order to make that string useable in your code you will need to convert it to a JavaScript object using JSON.parse. JSON.stringify essentially does the opposite, that’s all you need to know to get started. Ditch the XML or SQL if you’re using it. JSON is the future, back to front!</p><p>Thanks for your attention, it’s the most valuable thing you can give anyone. The hardest thing about writing these posts is often getting started, so any suggestions/requests for topics would be appreciated! I also welcome feedback on <a href="https://medium.com/me/stories/public">previous posts.</a></p><p>If you liked what you have read here and would like to hear more from me please feel free to sign up for my e-mail list on my personal site <a href="https://feargalwalsh.us17.list-manage.com/subscribe/post?u=de3b08e1cdd1bfe1557a056ab&amp;id=c5dad51e33">here</a>, or at the very least…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QqWj9KV-HAc4xPGUyw2eRQ.png" /><figcaption><a href="https://www.youtube.com/watch?v=DdCYMvaUcrA">https://www.youtube.com/watch?v=DdCYMvaUcrA</a></figcaption></figure><h4>Resources</h4><ul><li><a href="https://www.gq.com/story/jeb-bush-saddest-moments">The 15 Saddest Moments of Jeb Bush&#39;s Presidential Campaign</a></li><li><a href="http://speakingjs.com/es5/ch22.html">Chapter 22. JSON</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON">Working with JSON - Learn web development | MDN</a></li></ul><p><a href="https://www.zazzle.com/json_data_interchange_format_business_card-240832802419898189">https://www.zazzle.com/json_data_interchange_format_business_card-240832802419898189</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feae4e125d5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Debugging tips and tricks]]></title>
            <link>https://codeburst.io/react-native-debugging-tips-and-tricks-9700012121bf?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/9700012121bf</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Fri, 13 Apr 2018 16:58:39 GMT</pubDate>
            <atom:updated>2018-04-13T21:17:27.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UJ7DFDN4QI3fWFkW6Vfryw.png" /></figure><p>You may be wondering why you should learn debugging tools. The truth is that for a lot of cases they are overkill and there are less overwhelming means of finding out where your program is failing(I’m looking at you print statements). However, as your app becomes more and more unwieldy you will need to start employing the services of a debugger.</p><h4><strong>The Chrome dev tools</strong></h4><p>A lot of the devtools including the debugger is still confusing to me. However, this is part and parcel of being a developer, and the more comfortable in environments you don’t fully understand you can be, the further you’ll go. This goes for listening to people who are explaining concepts to you have that you have no clue about too. It’s the times when you feel like everything is going over your head that are the times when you are learning the most, your brain is just processing information too fast.</p><h4>Starting at the beginning</h4><p>The first step in getting the devtools up and running for your app is to hit Cmd+D(iOS) or Cmd+M(Android) while the simulator is open and click ‘Debug JS Remotely’ like so:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F8OGSw6HNk8RguWsKMD%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Freact-native-debugging-8OGSw6HNk8RguWsKMD&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F8OGSw6HNk8RguWsKMD%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="255" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f9ff524b782d5ad3d2d07149f730d6d/href">https://medium.com/media/0f9ff524b782d5ad3d2d07149f730d6d/href</a></iframe><p>As you can see, this should then trigger the React native debugger tab to open in Chrome, as long as that’s your default browser. I don’t know what the keyboard shortcut to do this is in Windows is but I’m sure it’s easily Googleable. One thing to bear in mind as regards keeping this debugger open is that if you have to kill your app for some reason and start it again, they may slow down your app a lot when you relaunch it. But, sometimes the Cmd+D/M shortcut doesn’t work when you’re app is launching. So you can end up with your app hanging on the launching screen for a long time with no means of getting around it aside from running Simulator =&gt; Hardware =&gt;Erase all content and settings, killing the packager and running react-native run-ios again. Throwing an npm cache verify in there too probably wouldn’t hurt.</p><h4>Redux logger</h4><p>Great intro to the value of monitoring your app with the dev tools, <a href="https://codeburst.io/redux-persist-the-good-parts-adfab9f91c3b">this post </a>outlines how it works.</p><h4>Error messages</h4><p>The chrome devtools are also excellent for error messages. Using the simulator to transfer your error messages from there into the Google search bar (the hacker pilgrimage 👨🏻‍💻) can be awkward. React Native recently introduced a copy keyboard shortcut into the simulator, but it doesn’t work perfectly. So, having a cursor and the ability to copy and paste the message from the Console tab in the devtools is a lifesaver.</p><h4>Setting breakpoints</h4><p>This is the most powerful but also confusing of the dev tools features. The fundamental idea of breakpoints is that you are waiting for your app to reach a certain point and then inspecting how it behaves, line by line of code. This can be really useful, but you can also encounter a lot overwhelming information when you are stepping through the library functions that are being called as you step through your code.</p><h4>The break-up 🤦🏻‍</h4><p>Thanks for your attention, it’s the most valuable thing you can give anyone. The hardest thing about writing these posts is often getting started, so any suggestions/requests for topics would be appreciated! I also welcome feedback on <a href="https://medium.com/me/stories/public">previous posts.</a></p><p>If you liked what you have read here and would like to hear more from me please feel free to sign up for my e-mail list on my personal site <a href="https://feargalwalsh.us17.list-manage.com/subscribe/post?u=de3b08e1cdd1bfe1557a056ab&amp;id=c5dad51e33">here</a>, or at the very least…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QqWj9KV-HAc4xPGUyw2eRQ.png" /><figcaption><a href="https://www.youtube.com/watch?v=DdCYMvaUcrA">https://www.youtube.com/watch?v=DdCYMvaUcrA</a></figcaption></figure><h4>Resources</h4><p><a href="https://www.google.com/search?hl=en&amp;q=chrome+debugger+devtools">https://www.google.com/search?hl=en&amp;q=chrome+debugger+devtools</a></p><p><a href="https://developers.google.com/web/tools/chrome-devtools/javascript/">https://developers.google.com/web/tools/chrome-devtools/javascript/</a></p><figure><a href="http://bit.ly/codeburst"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3hPOj27LTt0ZPn5TQuhZg.png" /></a></figure><blockquote>✉️ <em>Subscribe to </em>CodeBurst’s<em> once-weekly </em><a href="http://bit.ly/codeburst-email"><strong><em>Email Blast</em></strong></a><strong><em>, </em></strong>🐦 <em>Follow </em>CodeBurst<em> on </em><a href="http://bit.ly/codeburst-twitter"><strong><em>Twitter</em></strong></a><em>, view </em>🗺️ <a href="http://bit.ly/2018-web-dev-roadmap"><strong><em>The 2018 Web Developer Roadmap</em></strong></a><em>, and </em>🕸️ <a href="http://bit.ly/learn-web-dev-codeburst"><strong><em>Learn Full Stack Web Development</em></strong></a><em>.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9700012121bf" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/react-native-debugging-tips-and-tricks-9700012121bf">React Native Debugging tips and tricks</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>
        <item>
            <title><![CDATA[What you need to know about functional stateless components in React and React Native]]></title>
            <link>https://medium.com/zonder-tech/what-you-need-to-know-about-functional-stateless-components-in-react-and-react-native-a57c254398c5?source=rss-41831c2598ee------2</link>
            <guid isPermaLink="false">https://medium.com/p/a57c254398c5</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[zonder]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Feargal Walsh]]></dc:creator>
            <pubDate>Thu, 05 Apr 2018 23:00:42 GMT</pubDate>
            <atom:updated>2018-04-20T18:01:25.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*cdhRv6RDRXWnfmMSk2bV7Q.png" /></figure><p>At <a href="https://medium.com/u/9746fe9ecd5f">Zonder</a> we use Functional Stateless Components as much as we possibly can. The ability to modularize entire screens into small manageable blocks is priceless to us as it enables us to quickly build components and pass them around our app. This is extremely useful when feedback is starting to roll in and we want to quickly iterate on parts of the app without having to completely redesign the architecture. It also enables us to reuse components, for example: this flatList that I designed recently can be used anywhere in the app. The style and props are fully editable and decoupled from the flatlist itself.</p><pre>const FSCList = ({data}) =&gt; {</pre><pre>return (</pre><pre>&lt;List&gt; //from react-native-elements libraty</pre><pre>    &lt;FlatList</pre><pre>        style={styles.flatListStyle}</pre><pre>        horizontal={false}</pre><pre>        data={data}</pre><pre>        keyExtractor={(item, index) =&gt; item.id}</pre><pre>        renderItem={({item}) =&gt; (</pre><pre>          &lt;ListItem</pre><pre>          title= {item.name}</pre><pre>          hideChevron = {true}</pre><pre>          /&gt;</pre><pre>      )}</pre><pre>   /&gt;</pre><pre>&lt;/List&gt;</pre><pre>)}</pre><p>The component FSCList can be passed around like a variable, in order to call it all you have to do is specify the props you want to use either by passing them using mapStateToProps which is what I have done here or by passing them when you create an instance of the list in another component like so:</p><pre>&lt;View {style = styles.FSCListContainer}&gt;</pre><pre>    &lt;FSCList&gt;</pre><pre>     data = {this.props.FSCListData}</pre><pre>    &lt;/FSCList&gt;</pre><pre>&lt;/View&gt;</pre><p>This parent component could be either an FSC or a stateful component, in the case of the stateful component the data could be passed using {this.state.FSCListData}.</p><p>This is by far the most intuitive and simple means of generating reusable and modularized code that I have come across. The combination of this technique and redux allows you to access your state as props anywhere in your code, all you need is the <a href="https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options">connect</a> keyword at the end of your component. I can’t speak highly enough of this method as far as developer productivity is concerned. Actually getting stuff working on the screen that your boss and users cares about rather than fiddling around with complex coupled components becomes a breeze.</p><p>Thanks for your attention, it’s the most valuable thing you can give anyone. The hardest thing about writing these posts is often getting started, so any suggestions/requests for topics would be appreciated! I also welcome feedback on <a href="https://medium.com/me/stories/public">previous posts.</a></p><p>If you liked what you have read here and would like to hear more from me please feel free to sign up for my e-mail list on my personal site <a href="https://feargalwalsh.us17.list-manage.com/subscribe/post?u=de3b08e1cdd1bfe1557a056ab&amp;id=c5dad51e33">here</a>, or at the very least…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QqWj9KV-HAc4xPGUyw2eRQ.png" /><figcaption><a href="https://www.youtube.com/watch?v=DdCYMvaUcrA">https://www.youtube.com/watch?v=DdCYMvaUcrA</a></figcaption></figure><p><strong>Special Thanks</strong></p><p><a href="https://medium.com/u/37a69f4976b">Noah Allen</a> for the guidance when I was struggling with this concept.</p><p><a href="https://medium.com/u/4a9cfe1fe6e3">Demi</a> and <a href="https://medium.com/u/6a6e74e77acf">Harry</a> for the opportunity to contribute to the mission in this way.</p><h4>Resources</h4><ul><li><a href="https://javascriptplayground.com/functional-stateless-components-react/">Functional Stateless Components in React</a></li><li><a href="https://www.gq.com/story/jeb-bush-saddest-moments">The 15 Saddest Moments of Jeb Bush&#39;s Presidential Campaign</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a57c254398c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zonder-tech/what-you-need-to-know-about-functional-stateless-components-in-react-and-react-native-a57c254398c5">What you need to know about functional stateless components in React and React Native</a> was originally published in <a href="https://medium.com/zonder-tech">Zonder Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>