<?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 José Rogério on Medium]]></title>
        <description><![CDATA[Stories by José Rogério on Medium]]></description>
        <link>https://medium.com/@joserogeriofilho?source=rss-71ea27f3e00f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*tFY0AZ52P7zQtn4X2wafCA.jpeg</url>
            <title>Stories by José Rogério on Medium</title>
            <link>https://medium.com/@joserogeriofilho?source=rss-71ea27f3e00f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:50:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joserogeriofilho/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[Awesome React Articles]]></title>
            <link>https://medium.com/@joserogeriofilho/awesome-react-articles-72d3e50ea6b9?source=rss-71ea27f3e00f------2</link>
            <guid isPermaLink="false">https://medium.com/p/72d3e50ea6b9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[José Rogério]]></dc:creator>
            <pubDate>Wed, 25 Mar 2020 19:08:33 GMT</pubDate>
            <atom:updated>2020-03-25T19:33:42.542Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*eWFephGhKH06uPxqd06ZhA.png" /><figcaption>Image source <a href="https://undraw.co/illustrations">unDraw</a></figcaption></figure><p>The React official documentation is a much safer source of information than random internet articles but sometimes you need a different approach or more practical examples in order to understand a feature or a common pattern. Besides, when dealing with other technologies commonly used in conjunction with the React library, like Redux, one can learn a lot from well written articles that talk about how to better integrate them.</p><p>Here is a list of a few articles that I really enjoyed and a brief description of what each one of them talks about (in case the title isn’t clear enough) and why I liked it.</p><h3>File Structure</h3><h4><a href="https://medium.com/@Charles_Stover/optimal-file-structure-for-react-applications-f3e35ad0a145">Optimal File Structure for React Applications (2019)</a></h4><p>A coherent and practical file structure and naming convention for your React projects. This article even references where keeping your hooks functions, test files and routing components. According to the author, the suggested structure is what worked the best for him over his three years as a React developer. I myself feel more confident when structuring my projects after having adopted his conventions.</p><h3>Patterns</h3><h4><a href="https://css-tricks.com/learning-react-container-components/">Leveling Up With React: Container Components (2017)</a></h4><p>A 2017 article that is still relevant for introducing a classical pattern in React development: container components x presentational components (state x stateless components).</p><h4><a href="https://www.robinwieruch.de/conditional-rendering-react">All React Conditional Rendering Techniques (2020)</a></h4><p>A list of conditional rendering in React component including the JavaScript ternary operator and the short-circuit strategy.</p><h4><a href="https://www.robinwieruch.de/react-render-props">React Render Props (2018)</a></h4><p>This article explains in a simple and direct way the common React pattern called render props, which is basically composing React components using functions instead of the props.children. This lets you use the state of the parent component as props n these function components.</p><h4><a href="https://www.robinwieruch.de/react-higher-order-components">React Higher Order Components (2017)</a></h4><p>The author uses several conditional renderings inside a component which shouldn’t be there in the first place as a motivation to use High Order Components (HOC). With small steps between each refactoring, the article shows how to create HOCs that replace the conditional renderings inside the original component.</p><h4><a href="https://codeburst.io/react-hooks-conceptual-understanding-part-1-5deb04e89f0">React Hooks (Conceptual Understanding) — Part 1</a></h4><p>This article explains the React hooks useState, useEffect, useReducer and useContext. It lacks however examples and explanations about how to use useReducer and useEffect together for a global state manager but it is still important to understand each one of them separately and it does it very well.</p><h3>Routes</h3><h4><a href="https://medium.com/javascript-in-plain-english/routing-and-navigation-in-react-cffc26e8a389">How to handle routing and navigation in React JS (2019)</a></h4><p>A proposal of routes component division into RouteWrapper (that deals with private routes protection and whatever other routing logic you might have) and Routes (a list of RouteWrapper encapsulated by a Switch component).</p><h4><a href="https://codeburst.io/getting-started-with-react-router-5c978f70df91">Getting started with React Router (2018)</a></h4><p>A brief introduction to some of the things we usually do when configuring the routes in our applications: activated links, not found pages, parameters and nested routing.</p><h3>Redux</h3><h4><a href="https://daveceddia.com/what-does-redux-do/">What Does Redux Do? (and when should you use it?) (2017)</a></h4><p>A simple and direct explanation of Redux and its motivation along with an overview of React data flow.</p><h4><a href="https://daveceddia.com/where-fetch-data-redux/">Where and When to Fetch Data With Redux (2018)</a></h4><p>This article introduces the BEGIN, SUCCESS and FAILURE Redux action convention. Any action that fetches data from the server will first dispatch the BEGIN action to the reducer and, eventually, the SUCCESS or FAILURE actions according to the result. To return functions instead of objects in the reducer, the redux-thunk middleware is used.</p><h4><a href="https://dev.to/markusclaus/fetching-data-from-an-api-using-reactredux-55ao">Fetching data from an api using React/Redux (2019)</a></h4><p>Similar to the previous text but it is less focus on the BEGIN, SUCCESS, FAILURE convention and more on file separation and practical example construction.</p><h3>Tests</h3><h4><a href="https://www.valentinog.com/blog/testing-react/"><strong>Testing React Components with react-test-renderer and the Act API (2020)</strong></a></h4><p>This article talks about two kinds of React unit testing: snapshot and DOM testing. Because it was written before React v3.3.0, it favors the use of the react-test-renderer library instead of the react-testing-library (which is now recommended in the official docs) for rendering components and even encapsulating state changes so it might be a great complement for the React official documentation.</p><p>I hope that you can find this list as useful as I did. I’ll try to add more items for other important stuff like authentication and Firebase integration in a close future.</p><p>Please, feel free to visit my <a href="https://github.com/joserogeriofilho"><strong>GitHub</strong></a><strong>, </strong><a href="http://www.linkedin.com/in/joserogeriofilho"><strong>Linkedin</strong></a><strong> </strong>and <a href="http://www.behance.net/joserogeriofilho"><strong>Behance</strong></a> profiles. Thank you for your time and have a great weekend you all ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72d3e50ea6b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Small Yet Complete React Application With Routes, Fetch and Bootstrap]]></title>
            <link>https://medium.com/@joserogeriofilho/a-small-yet-complete-react-application-with-routes-fetch-and-bootstrap-e431a67d5027?source=rss-71ea27f3e00f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e431a67d5027</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[José Rogério]]></dc:creator>
            <pubDate>Wed, 29 May 2019 18:01:09 GMT</pubDate>
            <atom:updated>2019-06-10T23:56:39.290Z</atom:updated>
            <content:encoded><![CDATA[<p>With the purpose of learning ReactJS and its most common patterns and tools (like react-route library), I developed a small but complete application with two main functionalities: user registration and a media card gallery, showing several material design cards in a grid format. The application uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">Javascript Fetch API</a> to read data from a mocked REST API and displays it using several small UI components, which are then used to form web responsive pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAAcQIDT7n9Cdjku1UCB6w.png" /></figure><h3>1. UI Components</h3><p>Most of the work was made in the user interface since the main purpose of the project was to teach myself the React library. Some individual UI components were built from scratch like the navigation drawer and the app bar while other components, like buttons and text inputs, were built on top of their Bootstrap web component.</p><p>The <strong>web responsiveness</strong> is mainly focused on the navigation drawer component and on the content of the three screens (home, user registration and media card listing). On the <strong>navigation drawer</strong> component, <strong>media queries</strong> were used on its own stylesheet file to display it on larger devices and to hide it in smaller ones (positioning it off the screen with a negative margin). Once hidden in mobile devices, a <strong>flag variable</strong> is used to move the navigation drawer to <strong>visibility </strong>and off the screen again by a click event on the hamburger icon that changes the variable value. On the <strong>pages’ </strong>content<strong>, </strong>however, none React code was necessary to achieve web responsiveness and the use of the <a href="https://getbootstrap.com/docs/4.0/layout/grid/"><strong>Bootstrap grid system</strong></a> was enough.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2aa3e61de923e31adec2a1d47a371824/href">https://medium.com/media/2aa3e61de923e31adec2a1d47a371824/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76019f4b14f07df077053bf2124240b2/href">https://medium.com/media/76019f4b14f07df077053bf2124240b2/href</a></iframe><p>Some React patterns, as seen in <a href="https://reactpatterns.com/">reactpatterns.com</a>, can be found in the showcase UI components:</p><ul><li><strong>Function components</strong> <em>(simplest way to declare a component in the form of a function)</em>: AppBar, MediaCard, NavItem, AdvancedSearchPage and CardGridPage;</li><li><strong>Array as children</strong> <em>(use of map() to iterate through an array, creating a list of sub-components)</em>: MediaCardGrid, NavDrawer and UserList;</li><li><strong>Container component</strong> <em>(the container component does data fetching and renders it in sub-components)</em>: MediaCardGrid and UserRegistrationPage;</li></ul><h3>2. API and Fetching</h3><p>To make things closer to real life development, I used the <a href="https://github.com/typicode/json-server"><strong>JSON Server</strong></a> library to create a mocked REST API, allowing the use of <strong>JavaScript Fetch</strong> to get data through asynchronous HTTP requests. This set up made it possible to handle error and loading state in the same way it would be done with a real service, having no need for modification if the back end was replaced by a real REST API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2528cec0857820a9e784b3a627367fdb/href">https://medium.com/media/2528cec0857820a9e784b3a627367fdb/href</a></iframe><p>For this first version of the application, I decided to do the fetching in the <a href="https://reactpatterns.com/#container-component"><strong>container components</strong></a> that directly renders the data or at least use sub-components to do so.</p><h3>3. Overview</h3><p>In summary, the application consists of (1) individual UI components, (2) pages composed by UI components, (3) stylesheet files that support (4) themes that can be choosen without prejudice to the components structural properties and (5) a JSON file that simulates a REST API with the use of the JSON Server library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URqatieQHuXg2mIb1ull6Q.png" /></figure><h3>4. Next Release Improvements</h3><ul><li>Better structuring of the stylesheet files, moving them next to their React components;</li><li>Improvement in some UI components and page construction, in particular the AppBar component;</li><li>Change from a container component pattern to a DAO pattern for fetching to see if it improves the software scalability and maintenance of the project;</li><li>Use of Redux;</li></ul><p>And that’s the end of it for now. Please, feel free to visit the project <a href="https://github.com/joserogeriofilho/react-showcase"><strong>GitHub repository</strong></a> or the <a href="https://react-showcase-client.herokuapp.com/"><strong>live demo</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e431a67d5027" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Things I learned Building My First Bootstrap Theme]]></title>
            <link>https://medium.com/@joserogeriofilho/3-things-i-learned-building-my-first-bootstrap-theme-1a93e653ca65?source=rss-71ea27f3e00f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a93e653ca65</guid>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[material-design]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[José Rogério]]></dc:creator>
            <pubDate>Tue, 11 Dec 2018 18:36:07 GMT</pubDate>
            <atom:updated>2020-06-30T01:31:41.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wm-5WFdH9PumO-g9Y4OjBw.png" /><figcaption>Sunset: A Bootstrap 3 Material Theme</figcaption></figure><p>Once I realized that I had fallen in love with UI design I knew that I needed to renew my web design skills. So I set up to create a Bootstrap theme since this would be a great way to exercise my UI/UX design skills as well as my web design ones. And indeed it was. By the way, feel free to visit the project’s <a href="https://github.com/roger-sama/sunset"><strong>GitHub repository</strong></a> or check out the <a href="https://joserogeriofilho.github.io/sunset/components.html"><strong>live demo</strong></a>.</p><p>First of all I had to make a few decisions regarding this project:</p><ul><li>Use of Bootstrap 3 instead of Bootstrap 4 to prevent React incompatibility;</li><li>Choosing SASS as a CSS pre-processor since it is also used at the company I’m currently working;</li><li>Use of Bootstrap <a href="https://getbootstrap.com/docs/3.3/examples/theme/">theme example</a> as a starter template;</li><li>Following the Material Design guidelines with just a few adaptations.</li></ul><p>Once these choices were made it was easy for me to start coding right away because I already had a list of initial requirements (the Bootstrap theme template) and design guidelines (Material Design). I just had to update the list of components in my requirements as the project became more mature.</p><p>So without further ado, here’s some insights and learned lessons I think it’s interesting to share.</p><h3>1) Having a Primary SASS File</h3><p>Instead of having a huge “Highlander” style sheet (there can be only one!) I chose to have a <strong>single primary SASS file that imports multiple smaller ones</strong>. Using this strategy, each visual component (panels, cards, sidebar, inputs etc) has its own SASS file located in the <em>/components</em> folder. The theme primary SASS file than imports every one of the SASS files inside /components. This <strong>improves the scalability and maintenance</strong> of the code since we only have to deal with a single and simple SASS file in order to edit a component or to add a new one. You can also quickly generate different versions of your theme by creating <strong>multiple color palettes variables</strong> in different SASS files and choosing which one to import in your primary file.</p><p>If you are using the <em>--watch</em> command it might be a good idea to use <a href="https://sass-lang.com/guide#topic-4">SASS partials</a> by having your component’s SASS files names start with an underscore. This way, SASS will know not to generate CSS code for these files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*3j4DBnKZVdbDuoXZ8o7DlA.png" /></figure><h3>2) Building the HTML Layout Structure</h3><p>It can be intimidating to have nothing but a blank HTML file on your editor screen. You may even have some wireframes to begin with but just don’t know how to start coding yet. It might seems obvious, but you should <strong>start with the layout structure</strong> of a page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*TgKo3IcIT9sjB9e5pByGDg.png" /></figure><p>Write some <em>DIVs</em> (or others semantic tags like <em>NAV</em>) to form your app bar, navigation drawer and content area, for example, and <strong>add just enough CSS</strong> so they can be at the <strong>right position and have approximately the right size</strong>. Once you do that, you’ll have a clear vision of your page’s architecture and it will be a lot easier to figure out how to implement the web design responsiveness.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Froger-sama%2Fembed%2Fpreview%2FZVzxPW%3Fheight%3D600%26slug-hash%3DZVzxPW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2Froger-sama%2Fpen%2FZVzxPW%2F&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/d11f638ed35a2afb358de37fa9eacde8/href">https://medium.com/media/d11f638ed35a2afb358de37fa9eacde8/href</a></iframe><h3>3) Navigation Drawer Transition</h3><p>The navigation drawer component has a simple behavior. In desktop devices it should be always visible, but when dealing with smaller devices its visibility should be toggle by the user using the hamburger menu button.</p><p>In a first attempt to implement this behaviour one might think of using the “display” or “visibility” CSS property to toggle the navigation drawer rendering. This however will <strong>prevent the use of transitions </strong>since this CSS property doesn’t work well wen the component it’s either invisible or has it’s “display” set to “none”.</p><p>To solve this, simply <strong>work with margins</strong> giving the component a negative “margin-left” (if it’s located on the left side of the screen) equal to its width. This way, not only will the component be completely out of the page’s view but also will permit a slide animation by simply adding a “transition” property to its container which will be visible when its “margin-left” return to 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*5UVD1Aa3peazwf5h9Ialxw.gif" /></figure><p>That was it, hope you have enjoyed it. Again, feel free to visit the project’s <a href="https://github.com/roger-sama/sunset"><strong>GitHub repository</strong></a> or the <a href="https://joserogeriofilho.github.io/sunset/components.html"><strong>live demo</strong></a>. This article is also available on <a href="https://www.linkedin.com/pulse/3-things-i-learned-building-my-first-bootstrap-theme-jos%C3%A9-rog%C3%A9rio/"><strong>Linkedin</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a93e653ca65" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>