<?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 Chris B on Medium]]></title>
        <description><![CDATA[Stories by Chris B on Medium]]></description>
        <link>https://medium.com/@cbrannen?source=rss-be8937e44bfc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TPkDvOpYK9Q58ZxtfXOEUA.jpeg</url>
            <title>Stories by Chris B on Medium</title>
            <link>https://medium.com/@cbrannen?source=rss-be8937e44bfc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:02:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cbrannen/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[Importing data into Firestore using Python]]></title>
            <link>https://medium.com/@cbrannen/importing-data-into-firestore-using-python-dce2d6d3cd51?source=rss-be8937e44bfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/dce2d6d3cd51</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[firestore]]></category>
            <dc:creator><![CDATA[Chris B]]></dc:creator>
            <pubDate>Sun, 06 Jan 2019 16:24:47 GMT</pubDate>
            <atom:updated>2019-01-07T09:25:37.500Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple guide to using the Firebase Admin SDK with Python to import data from a csv file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*vt-savZ2Dz1OsA4giAhorQ.png" /></figure><p>I’m a big fan of Firebase and have been using it to develop projects for a while, however I was struggling to find a simple way to import a large quantity of data into Firestore. The Realtime database has a nice import and export data functionality but currently no equivalent exists for Firestore, so I thought I’d use a Python script to achieve this.</p><p>Before we start, I’m assuming you have a project already setup in Firebase and are using Firestore, if not you can find the guides for how to <a href="https://firebase.google.com/">here</a>.</p><h4>Generating Service Account Key</h4><p>To use the SDK we’ll need to have a Service Account Key. You can generate this by using <em>Firebase Console &gt; Project Settings:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*qy1RXHIlk_1fzzSxono7xg.png" /></figure><p>Then selecting <em>Service accounts</em><strong><em> </em></strong>and clicking <strong>Generate new private key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oODt-qmNfB2x5PhXHbBkg.png" /></figure><p>This will produce a .json file with the credentials needed to access the Firebase project.</p><p><strong>IMPORTANT! Keep this confidential, don’t add it to version control or to a client side application.</strong></p><p><strong>Setting up Python project</strong></p><p>Now that we have got the Service Account Key we can set up the Python project, if you are used to setting up python projects obviously do this in your preferred way, but just in case.</p><p>Assuming you’ve got a version of Python installed, I would recommend at least 3.4 and also using a <a href="https://pypi.org/project/virtualenv/">virtualenv</a>. Create a folder for the project and initialise the virtual environment using:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3aaeb2d230069ecab7027612a18945fb/href">https://medium.com/media/3aaeb2d230069ecab7027612a18945fb/href</a></iframe><p>Once completed type the path to the activate script in the virtual environment this is located in env\scripts folder for example: .\env\Scripts\activate.bat</p><p>This starts the environment for use in the terminal you’ll see it’s name in front of the prompt i.e. (env)</p><p>Then install:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46267078f6cc02ebe55ba1190d586cc2/href">https://medium.com/media/46267078f6cc02ebe55ba1190d586cc2/href</a></iframe><p>This provides firebase-admin package to allow the connections as well as the google-cloud-firestore package.</p><p>Move your copy of the Service Account Key to the working folder, and for ease I renamed mine to <strong>ServiceAccountKey.json</strong>. It’s probably a good time to add it to your <strong>.gitignore</strong> file, if using git, to avoid accidentally committing it.</p><h4>Connecting to Firestore</h4><p>You can now connect to the Firestore for your project, I’ll just demonstrate how to do this and get some data then go on to adding data imported from a csv file.</p><p>Add a <strong>main.py</strong> file to the folder with the below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4beb0b2c84128bb7b1320238c565897c/href">https://medium.com/media/4beb0b2c84128bb7b1320238c565897c/href</a></iframe><p>This reads from the collection <em>users, </em>limiting the returned results to just<em> </em>2 as I didn’t want all of the <em>users </em>collection returned. The script then prints the data as a dictionary.</p><p>Now we can connect and get data, lets add some to Firestore, just by changing the <strong>main.py</strong> to below, we can add a collection called <em>test </em>and a new document with the attributes of <em>name </em>and <em>added</em> and their values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40fbe1ce6e3c4f460aa45dc0153bd9b7/href">https://medium.com/media/40fbe1ce6e3c4f460aa45dc0153bd9b7/href</a></iframe><h4>Adding Data from csv to Firestore</h4><p>Adding data from a csv file requires us to read the csv in and then group the data to be added into transactions of up to 500 as the Firestore batch writes function has a limit of this.</p><p>For this example I’m just using a flat data structure but you could expand upon this to allow for more complex structures to be added.</p><p>I’ve got a list of UK based breweries and want to add this to a new Firestore collection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*NGQNdxoLO3vvou_KcPP5PQ.png" /></figure><p>The file contains Name and County fields for each brewery and I’ve cleaned the data beforehand, so there are no empty values.</p><p>We can now update the <strong>main.py</strong> file to below, changing the <strong>CSV_FILE_PATH </strong>and <strong>COLLECTION_TO_ADD_TO </strong>variables to appropriate values, in my case <em>Breweries.csv</em> and <em>breweries</em> respectively.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5077efb656c7cc369b1c11771fe11c7/href">https://medium.com/media/c5077efb656c7cc369b1c11771fe11c7/href</a></iframe><p><strong>Note</strong>: This script makes some assumptions to be aware of, the csv file’s first row are headers which are used to be the property names of the following rows i.e.</p><p><em>name,county<br>item1,item2</em></p><p><em>becomes { name: item1, county: item2}</em></p><p>We’ve also used the batch function from the Firestore client, this allows for set(), update() and delete() operations. Therefore to add a new document we must first create a new document (line 42) and then set the data for it in the batch (line 43).</p><p>The function batch_data is to restrict the operations per batch to the Firestore limit of 500, I used 499 to be safe.</p><p>Running the script now populates the Firestore collection with the values in the csv.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ka2ugBPw-0JGmBiEMJHDxw.png" /></figure><p>You can also retrieve the data from and compare it with the original data to check the process using a script similar to:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/073f1283c2dec03ad7ae6bb2c8ab56fa/href">https://medium.com/media/073f1283c2dec03ad7ae6bb2c8ab56fa/href</a></iframe><p>This script gets a count of the data rows, by changing the <strong>COLLECTION_TO_CHECK </strong>variable to the collection you want to check.</p><h4>Conclusion</h4><p>This is a simple guide to using the Firestore Admin SDK with Python to add and retrieve data, you can adapt these scripts to do more complex actions. You could also change the data format being added to one with sub collections or different variable types.</p><p>Hopefully this has been helpful, thanks for reading.</p><p>A big thank you to <a href="http://twitter.com/ThatJenPerson">@ThatJenPerson</a> and the excellent <a href="https://youtu.be/yylnC3dr_no">video guide</a> which was a huge help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dce2d6d3cd51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting your hooks into React]]></title>
            <link>https://medium.com/@cbrannen/getting-your-hooks-into-react-a7b9b8694959?source=rss-be8937e44bfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7b9b8694959</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Chris B]]></dc:creator>
            <pubDate>Mon, 12 Nov 2018 17:40:58 GMT</pubDate>
            <atom:updated>2018-11-12T17:40:58.163Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Writing your first React hook. How to setup a project to write your first hook.</em></p><p><em>If you want to view the end result the repository is </em><a href="https://github.com/cbrannen9a/react-hooks-example"><em>here</em></a><em>.</em></p><p>Everyone is talking about <strong>Hooks</strong> at the moment it seems and this is great, getting the community involved in the development of <strong>React</strong> and it’s new features is definitely one of its strengths. Hooks are just in alpha at the present and Dan Abramov suggests a note of caution before launching into them, but they are shiny and new so who doesn’t want to have a play!</p><p>Just before we do it’s worth checking out their announcement at React Conf 2018 by <a href="https://mobile.twitter.com/sophiebits">Sophie Alpert</a> and <a href="https://medium.com/@dan_abramov">Dan Abramov</a> followed by a deeper dive by <a href="https://mobile.twitter.com/ryanflorence">Ryan Florence</a> here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fdpw9EHDh2bM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Ddpw9EHDh2bM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fdpw9EHDh2bM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad70d92540011512f84156a5f5c802a0/href">https://medium.com/media/ad70d92540011512f84156a5f5c802a0/href</a></iframe><p>Along with the article, <a href="https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889">Making Sense of React Hooks</a> which explains some of the reasons for using them and their proposed uses.</p><h4>Setup</h4><p>To get the project setup in the easiest way for writing our first hook I’m going to use create-react-app to make life simple.</p><p>So in the root of your working folder:</p><pre>create-react-app react-hooks-example</pre><p>Then open the folder in a code editor. I use VSCode.</p><p>The current version of React in use is 16.6, which you can check by adding the following to <em>src/App.js </em>and then using the <strong>yarn start</strong> command to start the project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*N3plj96Kd05VY_7GykOxUg.png" /><figcaption>Adding console.log for React version</figcaption></figure><p>This will print the current React version in the developer tools console, in this case 16.6.1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*qNVZCK0N9Pirr4K9sODepA.png" /></figure><p>Hooks are currently available in the 16.7 alpha so to change to this version I used:</p><pre>yarn add react@next react-dom@next</pre><p>You’ll need to restart the app once the dependencies have installed, but you should then get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*YRHmci23oPRkbbhYSPpQkQ.png" /></figure><p><strong>(Optional)</strong> If you are using eslint there is a plugin to help identify any issues with your hooks which you can use by:</p><pre>yarn add eslint-plugin-react-hooks@next --dev</pre><p>Then adding the following .eslintrc file to the root of your directory:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e7a10278f0b100cded9880e4d69903d/href">https://medium.com/media/8e7a10278f0b100cded9880e4d69903d/href</a></iframe><h4>Writing your First Hook</h4><p>Now for the fun part!</p><p>Create a new file called <em>Example.js</em> in the <em>src</em> folder and write the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/663f82717fa8152b692bc945590dd064/href">https://medium.com/media/663f82717fa8152b692bc945590dd064/href</a></iframe><p>Remove the demo setup in the <em>App.js </em>and replace with the below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7ff087a3220cf353dee0d265819ce69/href">https://medium.com/media/c7ff087a3220cf353dee0d265819ce69/href</a></iframe><p>And you should now have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*G7FoM5Rr6CfYKKnBbZn2xA.png" /></figure><p><strong>Click the button as you have now written your first Hook </strong>🎉🎉🎉</p><p>This is a simple usage of the <strong>useState</strong> hook which declares a state variable <em>count </em>and a function to update the state<em> setCount.</em></p><p>You can now add additional Hooks and see what everyone is talking about. For example it’s easy to add the <strong>useEffect</strong> hook to update the document title by updating the <em>Example.js</em> to:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d700983cd78db29761f540b869e7380f/href">https://medium.com/media/d700983cd78db29761f540b869e7380f/href</a></iframe><p>This now gives an easy setup to learn Hooks. There are also plenty of other resources out there:</p><p><a href="https://github.com/rehooks/awesome-react-hooks">GitHub - rehooks/awesome-react-hooks: Awesome React Hooks</a></p><p>A useful list of Hook related resources.</p><p><a href="https://usehooks.com/">useHooks - The React Hooks Library</a></p><p>A daily React Hook, with some pretty cool example hooks.</p><p>There is also the proposal to add Hooks which can be found here:</p><p><a href="https://github.com/reactjs/rfcs/pull/68">RFC: React Hooks by sebmarkbage · Pull Request #68 · reactjs/rfcs</a></p><h4>Conclusion</h4><p>I hope this has been a helpful demo of how to test out React’s new proposed feature. You can find a repository <a href="https://github.com/cbrannen9a/react-hooks-example">here</a> which contains the result of the process above.</p><p>Thanks for reading. If you liked the story please hit the “Follow” button or clapping. I’m going to start adding articles each week in which I hope to be exploring more features in various languages and adding further tutorials. Many Thanks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqgjWV0tsLdp-wzUoRPB6Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7b9b8694959" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fun with Fragments, an adventure in React]]></title>
            <link>https://medium.com/@cbrannen/fun-with-fragments-an-adventure-in-react-f5928dd43b09?source=rss-be8937e44bfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5928dd43b09</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[fragments]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[material-ui]]></category>
            <dc:creator><![CDATA[Chris B]]></dc:creator>
            <pubDate>Thu, 08 Nov 2018 16:25:02 GMT</pubDate>
            <atom:updated>2018-11-08T21:15:00.554Z</atom:updated>
            <content:encoded><![CDATA[<p>An exploration of using Fragments in React with state.</p><p><em>If you want to view the end result it can be found </em><a href="https://github.com/cbrannen9a/fragmented-form"><em>here</em></a><em> along with a </em><a href="https://cbrannen9a.github.io/fragmented-form/"><em>demo</em></a></p><p>Fragments were highlighted in React 16.2 back in November 2017 <a href="https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html">https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html</a> and there are plenty of examples out there showing simple usage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIsw4sPYfb83Z2n4vPmxnw.png" /><figcaption>An example of using React Fragments</figcaption></figure><p>This is useful as it saves the additional wrapping of children in extra elements such as a div or span.</p><p>It’s worth noting the syntax for a Fragment can also be expressed explicitly, and whilst I’m all for the shortening of code I think I prefer the readability this provides instead, so the above can be written either as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e55b09b37a92221686314d1135bcb91/href">https://medium.com/media/2e55b09b37a92221686314d1135bcb91/href</a></iframe><p>or</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac75476e4e5a3bfc3657817cd3ca77b8/href">https://medium.com/media/ac75476e4e5a3bfc3657817cd3ca77b8/href</a></iframe><p>I’ll leave the preference of which to use up to you, but for this I’m going to use &lt;Fragment&gt;&lt;/Fragment&gt;</p><p>I recently started to use the Material-UI library <a href="https://material-ui.com/">https://material-ui.com/</a> . In the examples provided there was a Checkout <a href="https://material-ui.com/page-layout-examples/checkout/">demo</a>, the source code of which is found here: <a href="https://github.com/mui-org/material-ui/tree/master/docs/src/pages/page-layout-examples/checkout">https://github.com/mui-org/material-ui/tree/master/docs/src/pages/page-layout-examples/checkout</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8hQ09Y3ZyP8U0uNU7b6qg.png" /><figcaption>A stepper example using fragments</figcaption></figure><p>This demo used fragments to render the component parts for each step in the process, however there was no validation of the fields and the review form mock up ignoring previous inputs. This made me wondered how I might add these checks and functionality to this example.</p><p>The example code is segmented into four parts, an AddressForm, PaymentForm, Review step and the main Checkout component. Of these, Address, Payment and Review are Fragments which are accessed in the main component via:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06caaf019bde82fe75a527fc60b1a60d/href">https://medium.com/media/06caaf019bde82fe75a527fc60b1a60d/href</a></iframe><p>The Review needed access to the details added in both the AddressForm and PaymentForm and I wanted to limit progress through the steps if the required fields were not valid.</p><p>To try this out I used create-react-app to startup a demo and copied the code from the repository to <a href="https://github.com/cbrannen9a/fragmented-form">here</a> adding in the Material-UI dependencies and removing the starter css.</p><p>In the main Checkout form I added state for the respective areas:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66a61151e9035e4071e417dd3c93cef1/href">https://medium.com/media/66a61151e9035e4071e417dd3c93cef1/href</a></iframe><p>Along with a <strong>validation </strong>property to manage that side of the process. I added the <em>handleChange </em>function and passed both of these to the Fragments:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43cd60be99ad33b8ef1ed4cccbcd5860/href">https://medium.com/media/43cd60be99ad33b8ef1ed4cccbcd5860/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbade418b0c2349ee3c3d006b49efd73/href">https://medium.com/media/cbade418b0c2349ee3c3d006b49efd73/href</a></iframe><p>This allowed the Checkout state to be updated from the Fragments. In the AddressForm for the required fields I added <em>value </em>and <em>onChange</em> properties:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/517941aed87f0f947ad88f08db8b6819/href">https://medium.com/media/517941aed87f0f947ad88f08db8b6819/href</a></iframe><p>Now the Checkout’s state can be updated, we can also validate the field. To do so, after <em>setState </em>in the <em>handleChange </em>function I passed a second function to check the validation for the field.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5d54b8b11596d0d89929d20f1abc154/href">https://medium.com/media/a5d54b8b11596d0d89929d20f1abc154/href</a></iframe><p>This sets a property in the <strong>validation </strong>state for a field and adds an <em>errorType </em>with helper text. The <strong>fieldValidator</strong> is a function with a switch statement allowing you to handle the field appropriately. For most of the cases in this example, I have used that the value’s length is greater than 0. It also allows for more complex validation, which I did for the PaymentForm.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e72d32162470021c1dc622a348ae20a/href">https://medium.com/media/4e72d32162470021c1dc622a348ae20a/href</a></iframe><p>It also means the AddressForm’s fields can be updated with <em>error </em>and <em>helperText</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/196ec5ceac41ca4e01be1c4a1578287d/href">https://medium.com/media/196ec5ceac41ca4e01be1c4a1578287d/href</a></iframe><p>This means each required field is validated and returns some guidance to resolve any issues if not valid. To validate the form as a whole and prevent progress through the steps until each is complete, I added the <em>handleFormValidation </em>function called after each field validation which uses the <strong>formValidator</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d853c4e9091e559df4dfc43312587316/href">https://medium.com/media/d853c4e9091e559df4dfc43312587316/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f418888c1d09eca7fc3d84f18608e32b/href">https://medium.com/media/f418888c1d09eca7fc3d84f18608e32b/href</a></iframe><p>To prevent progress we can disable the Next step button with a simple check against the current step and it’s validity:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04695d9c7b51175710a18387517edd47/href">https://medium.com/media/04695d9c7b51175710a18387517edd47/href</a></iframe><p>We can repeat these steps for the PaymentForm and along with adding some of the additional, more complex, validation elements such as validating the credit card number. In this demo I used Regex and a luhnCheck but you might want to use alternatives in reality.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e34fe7c6c393d569178a4242f13f92a/href">https://medium.com/media/1e34fe7c6c393d569178a4242f13f92a/href</a></iframe><p>Pulling these together, results in the Checkout validating each step and allowing progress when the required fields are completed and validated as per the PaymentForm below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5L6kjz5tdjVfJSIONGySuA.png" /><figcaption>Example of passing fields for PaymentForm</figcaption></figure><h3>Conclusion</h3><p>This was a demo using Fragments in React with a more complex process than the simpler examples. I’m not 100% sure about their use in this way, so I welcome any discussion about this. You can find the complete repository <a href="https://github.com/cbrannen9a/fragmented-form">here</a> and the demo <a href="https://cbrannen9a.github.io/fragmented-form/">here</a> please .</p><p>Thanks for reading. If you liked the story please hit the “Follow” button or clapping. I’m going to start adding articles each week in which I hope to be exploring more features in various languages and adding further tutorials. Many Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5928dd43b09" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>