<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Artur Osypenko</title>
    <description>The latest articles on Forem by Artur Osypenko (@gmontag).</description>
    <link>https://forem.com/gmontag</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F332268%2F513cd0f3-5812-482b-ad5f-fdf361a2a124.jpeg</url>
      <title>Forem: Artur Osypenko</title>
      <link>https://forem.com/gmontag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gmontag"/>
    <language>en</language>
    <item>
      <title>Button react styled component</title>
      <dc:creator>Artur Osypenko</dc:creator>
      <pubDate>Sun, 22 Mar 2020 18:01:57 +0000</pubDate>
      <link>https://forem.com/gmontag/button-react-styled-component-2f4j</link>
      <guid>https://forem.com/gmontag/button-react-styled-component-2f4j</guid>
      <description>&lt;p&gt;From one project to another, I see the need to create my own set of shared UI components. For the first time, common public UI frameworks and libraries work well. But none of these projects work for me in the long run because it is always not enough flexibility. Sooner or later, you will face a situation when business requirements do not match available component props. You will create the wrapper with basically broke logic of the original one component and overwrite a bunch of styles. That is why better to put effort into improving knowledge in creating components from scratch. In my experience, 99% chances that you will hit that road.&lt;/p&gt;

&lt;p&gt;Without dispute about correctness, this is my recipe for on shared components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React, because that how I wired up.&lt;/li&gt;
&lt;li&gt;Typescript because it provides better instrument then PropTypes for controlling props. And the code becomes self-documented.
Even though typescript !== documentation tool, it is better than nothing&lt;/li&gt;
&lt;li&gt;Styled-components because it provides fully isolated components. Isolated on javascript and style levels. Even though some global styles are still been in use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Setup platform for UI playground without going to details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create-react-app with typescript configuration.&lt;/li&gt;
&lt;li&gt;Install the styled-component and add theme provider.&lt;/li&gt;
&lt;li&gt;Install normalize.css, add fonts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's create a simple, straightforward react button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;ButtonComponentProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;HTMLCollection&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MouseEvent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ButtonHTMLAttributes&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;HTMLButtonElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ButtonComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;otherProps&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;ButtonComponentProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;otherProps&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ButtonComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Add some styles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ButtonComponentProps&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;`
  padding: 5px 12px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  background-color: &lt;/span&gt;&lt;span class="p"&gt;${({&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
  border: 0px;
  border-radius: 3px;
  appearance: none;
  cursor: pointer;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Use the main page for a demonstration. Add state for a click's visual response. Just to make sure that it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;simpleButtonState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toggleSimpleButtonState&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSimpleButtonClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;toggleSimpleButtonState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;simpleButtonState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ThemeProvider&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Buttons&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Box&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;based&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;tag&lt;/span&gt; &lt;span class="kd"&gt;with&lt;/span&gt; &lt;span class="nx"&gt;custom&lt;/span&gt; &lt;span class="nx"&gt;focus&lt;/span&gt; &lt;span class="nx"&gt;behavior&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSimpleButtonClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;simpleButtonState&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Event&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;clicked&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Event&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Box&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Main&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ThemeProvider&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That is it. Or not?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is about input and div button?
&lt;/h2&gt;

&lt;p&gt;Short answer, &lt;strong&gt;you should avoid them&lt;/strong&gt; as much as possible. Both have other semantic meaning. And if you don't care about semantic, there could be accessibility disadvantages. For example, inputs should be provided with additional attributes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Click me!"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And for the div button, you should manually control keyboard events, such as press &lt;code&gt;Enter&lt;/code&gt; or &lt;code&gt;Space&lt;/code&gt; keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;tabindex=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;aria-pressed=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click me!&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;More information you can find &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about &lt;code&gt;outline:none&lt;/code&gt;? Will it provide poor accessibility?
&lt;/h2&gt;

&lt;p&gt;Yes, it is a pity to confirm, but even so many years past, we still have this problem. There is no automatic way to split click and keyboard focusing events. There is no existing native problem solution yet. What we can do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Leave outline. Actually, it not so bad. If you have rectangular buttons without rounded corners, it can work for you well. Just change color to be appropriate for our buttons and find peace with it.&lt;/li&gt;
&lt;li&gt;Disable outline and implement your focus styling. It is how most of the sites do right now. The problem is that it has an absolutely different behavior. There are millions of sites, and you &lt;strong&gt;must&lt;/strong&gt; figure out is button focused or not each time you visit a new one. So, if you decided to create our own focus styling, please make it recognizable. Use a contrast ratio of 3:1 with surrounding text and providing additional visual cues on focus buttons where color alone is used to identify them. More information &lt;a href="https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;:focus-visible&lt;/code&gt;. There is an existing solution on the horizon. This pseudo-class selector fires when the user focuses on button using a keyboard. And that means that you can disable outline in default &lt;code&gt;:focus&lt;/code&gt; selector and enable it in the &lt;code&gt;:focus-visible&lt;/code&gt; selector. Better without changing, just well known blue borders. But… it hasn't work yet. This is an experimental feature.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X7S2o8hf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sv96osxcos9yb4lizs9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X7S2o8hf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sv96osxcos9yb4lizs9u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The solution is focus-visible polyfill. This prototype adds a focus-visible class to the focused element, in the situation where &lt;code&gt;:focus-visible&lt;/code&gt; pseudo-class selector should match. Or &lt;code&gt;[data-focus-visible-added]&lt;/code&gt; attribute with is better for me. The main plus of this approach is that we leave native outline behavior as-is for keyboard events and hide it for clicks — a win-win situation.&lt;/p&gt;

&lt;p&gt;Add polyfill import:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;focus-visible/dist/focus-visible&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Add global styling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Main&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="s2"&gt;`
  ...
  *:focus:not([data-focus-visible-added]) {
    outline: none;
  }
  ...
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When the happy bright future will come, then I remove this polyfill and all &lt;code&gt;:focus-visible&lt;/code&gt; work natively. And we should be prepared for that. I will do that when Chrome, Firefox, and Safari provide support. Even though, after dropping polyfill, we still want some backward compatibility. You know, IE, Edge, and many other browsers. They let's say... exist. More about that backward compatibility &lt;a href="https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ButtonComponentProps&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;`
  ...
  /*
  Remove default focus styles for mouse users ONLY if
  :focus-visible is supported on this platform.
  */
  :focus:not(:focus-visible) {
    outline: none;
  }
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can find all source code on my &lt;a href="https://github.com/G-MontaG/ui-playground"&gt;GitHub repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>tutorial</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>It's never too late</title>
      <dc:creator>Artur Osypenko</dc:creator>
      <pubDate>Tue, 25 Feb 2020 21:33:25 +0000</pubDate>
      <link>https://forem.com/gmontag/it-s-never-too-late-3n20</link>
      <guid>https://forem.com/gmontag/it-s-never-too-late-3n20</guid>
      <description>&lt;p&gt;I believe that this post will be the start of the set of stories about my mentor's view of beginners. Today I would like to share encouraging real persons' situations who achieve their goals despite uncertainty, age, and lack of background.&lt;/p&gt;

&lt;p&gt;I have surprising statistics. Only two-thirds of students digest the theory. In the best case, half of them successfully apply knowledge in practice. It is about the majority of my students. If I ask them what the problem is, answers would be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's still too complicated, so I won't even try.&lt;/li&gt;
&lt;li&gt;It is is not my cup of tea.&lt;/li&gt;
&lt;li&gt;I'm not sure I need it.&lt;/li&gt;
&lt;li&gt;I think it's too late to start.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I can't get why it happens where so many free, publicly available materials are. They have even spent money on a paid course, and it is still a lot of doubts.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mark's story
&lt;/h1&gt;

&lt;p&gt;When I first met Mark, he was on the position of a House Manager in for a building company that owns a few premises. His job was in maintaining facilities, ordering supplies, hiring people to fix pipelines, or whatsoever. Mark is Ukrainian as I am, but he lives in the US. He won a Green card lottery a long time ago and built his new life, family, and career. The problem is that the company decided to reduce staff and Mark lost his job. There were not many openings for such type of work, and the nearest employer was far away from Mark's home.&lt;/p&gt;

&lt;p&gt;Shackled by the financial difficulties, Mark went back to his unused knowledge from Polytechnical University. He knew a little how to write code. So Mark decided to go through learning JavaScript code camp, which was pretty expensive. He did good enough not to be kicked out and not enough to be in the top 10 people who likely would get a job after completing the course.&lt;/p&gt;

&lt;p&gt;Here where I appeared. Mark decided to hire me as a tutor to help him cover all the gaps in his understanding of JavaScript, CSS, HTML, etc. The reason why he chose me was simple - I'm much cheaper than any US-based mentor. We worked intensively for 2 hours a week. It was an exciting mixture of knowing how to make asynchronous AJAX requests but having no idea what parts URL consists of and whether a need in those parts.&lt;/p&gt;

&lt;p&gt;Still, with perseverance and desire to become a Software developer, Mark expanded his knowledge in two months and what's more valuable - got on top 10 people in his code camp. When the course finished, he got three offers to junior positions and accepted one of them.&lt;/p&gt;

&lt;p&gt;Long story short, Mark didn't miss his previous job and felt like he just did the first step in a road to an exciting adventure.&lt;/p&gt;

&lt;h1&gt;
  
  
  Sofia's story
&lt;/h1&gt;

&lt;p&gt;The second story is about the student who was already over 30. This is the case when a student can teach a teacher. She had rich experience in the pharmaceutical industry. Her position was senior enough not to think about a lack of money. But the cons of this profession was the constant tension as such a business in Ukraine was often associated with an informal, shadowy part. She did not want to become the head of this, so she reached a so-called "glass ceiling".&lt;/p&gt;

&lt;p&gt;Due to less interaction with a computer than the younger generation, which is known for "holding a keyboard from birth", it was more difficult for her to grasp information. But she had the advantage of higher education. I do not mean a degree in computer science. Apparently, she learned to be a pharmacist. But she was given knowledge on how to gain more knowledge.&lt;/p&gt;

&lt;p&gt;Specifically, my course didn't help her to get a job right away, but I know that she wouldn't stop studying the front-end of technology. The question was rather not a lack of knowledge, but merely a decision - to break off relations with the current employer and build another future or stay where you are. I hope she will make the right decision for herself.&lt;/p&gt;

&lt;h1&gt;
  
  
  Anna's story
&lt;/h1&gt;

&lt;p&gt;That's an entirely different situation. It doesn't quite fit here because Anna is quite younger than me. Yet, I would like to emphasize the lack of any professional education. Being a non-technical person, Anna, from the beginning to the end, was the best in class. The reason is that she had a lot of desire and the delight of discovering something new.&lt;/p&gt;

&lt;p&gt;In fact, there was a little discovery for me that if you add a bit of humor to the examples or homework, you would love to do them with pleasure. Additionally, and most importantly, you could remember it better. It goes without saying not to overdo it. Otherwise, the lecture will turn into a circus.&lt;/p&gt;

&lt;p&gt;Right after the course, Anna went as a trainee to a startup, and a year later, she became a Junior JavaScript developer. She was lucky, work turned out to be exciting and full of new things. Now she is rapidly growing as a developer.&lt;/p&gt;

&lt;p&gt;Let's look at the key points from these stories. I put them in order of importance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Find the real motivation in yourself because you will need it. The threshold for enter the front-end technology is growing every day, and you need to find strength and perseverance to make the first step.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The presence of higher education. In any industry. It isn't essential. You can learn about Computer Science later. As I mentioned, Universities give you skills and tools on how to gain more knowledge.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have the desire to know everything, like a child has. Try to turn any routines into a game. Then it simply ceases to be a routine. Once we enjoy the process, time flows unnoticed, and we will have remembered this information for years with no extra efforts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>career</category>
      <category>motivation</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
