<?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>DEV Community: Vladislav Kresov</title>
    <description>The latest articles on DEV Community by Vladislav Kresov (@hellvinter).</description>
    <link>https://dev.to/hellvinter</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%2F267799%2Feeab2d04-c465-4c71-824f-6e15a0dd252e.jpg</url>
      <title>DEV Community: Vladislav Kresov</title>
      <link>https://dev.to/hellvinter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hellvinter"/>
    <language>en</language>
    <item>
      <title>Circle of Life in React</title>
      <dc:creator>Vladislav Kresov</dc:creator>
      <pubDate>Sun, 08 Mar 2020 12:23:51 +0000</pubDate>
      <link>https://dev.to/hellvinter/circle-of-life-in-react-j1g</link>
      <guid>https://dev.to/hellvinter/circle-of-life-in-react-j1g</guid>
      <description>&lt;p&gt;Disclaimer. That an import of my medium blog. All my tech blogs would now be published at Dev.&lt;/p&gt;

&lt;p&gt;In my previous blog posts, I forget to mention about the lifecycle of a component in React and methods that we use inside a class component. So let’s fill that gap and knowledge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s dive in&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we jump to methods, let discuss what is the life cycle of a component in react. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Belov is the lifecycle of React component&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;In a nutshell out component has a free life state. The first component is born ( add to virtual react-dom ). The second ( component update, if we computing some data ). And then if needed component died ( if your component placed in inside the main content tag you probably want it to die ( yep all react developers monsters and programming they’re child’s to be killed ).&lt;/p&gt;

&lt;p&gt;Ok, we have three states of components but what about methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;render() {&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We already highlighted it in my previous blog about a class component. That the only method strictly required by class component cause without it nothing will be rendered and also, the app will yell at you with all of its power of cyber lungs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Render method&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;As we discussed previously that method just renders all your JSX into the DOM. The thing to mention, render method is a pure function ( check out this blog about pure function in JS, click) and it’s not allowing any mutation of data inside it, only rendering of it. Because of that you should call or write other methods outside, before render and after a constructor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;componentDidMount () {&lt;/strong&gt;&lt;br&gt;
Your component mounted, loaded and ready for more action? Let’s make a call for API and bring the data!&lt;/p&gt;

&lt;p&gt;No seriously that methods are an ideal place to make an API calls and fetch the data from anywhere and render it on screen. Also here you can setState of the component and it will update it before the browser will update UI. Because of that toying with the state which depends on external data inside of that method is a good idea.&lt;/p&gt;

&lt;p&gt;And I’m too lazy for making a screenshot of code example for that component, so let’s go to the next subject.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;componentWillUpdate (prevProps) {&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another one good method to work with a changing state that invokes immediately after changes are happening.&lt;/p&gt;

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

&lt;p&gt;That method is good in many events that don’t associate with external data like, clicks or typing something in form. One thing to remember when working with this method. You always should check a previous state before the update if you not… an infinite loop will catch you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;componentWillUnmount () {&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As name methods say, it will unmount, destroy, crush, smash… hmm hmm. The component will be removed from the dom. It’s a healthy practice to clear the timers, canceling API calls inside that method.&lt;/p&gt;

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

&lt;p&gt;Little note. Because component will be destroyed and it never is re-render, so we cant modify state by calling setState() inside this method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A little conclusion. All of this lifecycle is a common practice when working with class components and have some pros and cons in each one. Less common methods exist too but cause I never used them, I don’t include them in the guide. As I say in the previous blog, in my opinion, the future of React lay in the valley of Hooks ( sounds creepy, but promising…. what with me today?). But I anyway will bring the light in the land of a class component.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React Class Component</title>
      <dc:creator>Vladislav Kresov</dc:creator>
      <pubDate>Sun, 08 Mar 2020 12:16:26 +0000</pubDate>
      <link>https://dev.to/hellvinter/react-class-component-37o2</link>
      <guid>https://dev.to/hellvinter/react-class-component-37o2</guid>
      <description>&lt;p&gt;Disclaimer. It's an import of my blog post from a medium that I wrote a couple of months ago.&lt;/p&gt;

&lt;p&gt;Today we will speak about the Class component.&lt;/p&gt;

&lt;p&gt;Class component it’s one of two choices in React when you build your app, another one it’s a functional component but it for another time.&lt;/p&gt;

&lt;p&gt;First thing first, what is Class in JavaScript, when was it implemented in the language and what it does?&lt;/p&gt;

&lt;p&gt;In a nutshell. JavaScript Class it’s a code sugar for object prototyping that was confusing some of the programmers, who switch from object-oriented programming languages based on classes. They appear at ES6 redaction of JS.&lt;/p&gt;

&lt;p&gt;It takes all the features of JS prototyping such as &lt;strong&gt;constructors&lt;/strong&gt; that provide the class ability to create a new object. Also, it uses &lt;strong&gt;this&lt;/strong&gt; property which refers to inner code to that particular class. &lt;strong&gt;Super&lt;/strong&gt; property that refers to other classes to the parent class.&lt;/p&gt;

&lt;p&gt;Ok, now we now how classes have appeared in JS and what they do.&lt;/p&gt;

&lt;p&gt;But how we use them in React?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic class component.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The class component before introducing hooks was our main choice to build an app and manage the state. And build in methods of a class component in React expand our possibilities to manipulate the virtual DOM. One of these methods is the render method, the main purpose of it lays in the name. It’s the only method that the class component requires strictly ( other methods it’s another topic to discuss ).&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;The picture above is a basic class component.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s the most basic class component that you can build. That particular component just renders JSX markup nothing more. But we have plenty of room to improve our components.&lt;/p&gt;

&lt;p&gt;Let’s add an ability to manage the state by defining the constructor method.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Above is an ES6 React class component&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Couple of things to explain. First, we import { Component } from ‘react’, that needs to extend Component to our ClassComponent, by doing this we create ES6 class and now we can use a constructor. To constructor, we pass props as a parameter, then inside a constructor, we define superclass super which refers to all inner props of a constructor to parent class ClassComponent ( why we even do this? I will explain that in another blog post, For now, just remember to do it every time you build a class component). And at last, we define our state by type this.state, for now, it’s an empty object, soon we will add something to state, and I explain state functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Managing the state. Events. Methods.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we properly set up our component and ready to provide some interactivity to its behavior. But how we do it?&lt;/p&gt;

&lt;p&gt;First, we need to understand what is the state in react. A component state is a JS object that contains the property value of the class component in the React library. We can display state value on the screen and modify it by events such as click, the input of data, etc ( full list of events on React Docs &lt;a href="https://reactjs.org/docs/events.html"&gt;https://reactjs.org/docs/events.html&lt;/a&gt; ).&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Above is state example.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Knowing what the state is we can now change its value by events. But behind each event must be some logic, so how we can change our state?&lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;methods&lt;/strong&gt;.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Example of method that change count&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can name methods as you want. Basically, it is a function that contains the behavior logic of your app and adds interactivity to a webpage after it bonded to the event ( like onClick in that scenario ). Let look to our little up closely.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Counter class component.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Before wrapup blog, let’s break down what going on here.&lt;/p&gt;

&lt;p&gt;I create an ES6 React class component by defining it with a served &lt;strong&gt;class&lt;/strong&gt; word, then &lt;strong&gt;extends component&lt;/strong&gt; by that I open for my self ES6 syntax and use a &lt;strong&gt;constructor&lt;/strong&gt;. Inside of constructor, I create a state object by typing &lt;strong&gt;this.state&lt;/strong&gt; and value to the state. Then I use a &lt;strong&gt;render&lt;/strong&gt; method to display data on the screen. After that, I create a custom method handleClick, inside of the method I use &lt;strong&gt;this.setState&lt;/strong&gt; to modify a state. Then I bind method in the constructor so it will work correctly, and finally, I use a method in onClick event ( don’t forget to type this before the method or it won't work ). And after all those steps simple Class component is ready.&lt;/p&gt;

&lt;p&gt;Tremble before my counter!!!!&lt;/p&gt;

&lt;p&gt;That all about the basics of a class component in React. Personally now I see the future of React in Hooks. But knowing how to use class components can’t be underestimated because many apps built by the React library already exist. One of your tasks on future work may be the responsibility of supporting old projects built by using class components and maybe add new features using them ( maybe it will be the demand of the project ( I don’t know why, but just in case )). So know how to use it it’s power and your advantage in job searching&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Who said, “What are Components in React”?</title>
      <dc:creator>Vladislav Kresov</dc:creator>
      <pubDate>Wed, 26 Feb 2020 12:19:36 +0000</pubDate>
      <link>https://dev.to/hellvinter/who-said-what-are-components-in-react-gi7</link>
      <guid>https://dev.to/hellvinter/who-said-what-are-components-in-react-gi7</guid>
      <description>&lt;p&gt;Disclaimer. It's one of the first blogs that I wrote on Medium. I decide to write my technical blogs on Dev so I just move some content here. Hope you would like it.&lt;/p&gt;

&lt;p&gt;Really what it is?&lt;/p&gt;

&lt;p&gt;According to React docs. Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.&lt;/p&gt;

&lt;p&gt;Components are a core concept of the React library. You can create magnificent things using that way of writing your code. But what is a component principle?&lt;/p&gt;

&lt;p&gt;Also, React use two types of component. Components based on function ( traditional or arrow function ) and Class component. But both these components deserve separate posts for both of them.&lt;/p&gt;

&lt;p&gt;But why bother to use components?&lt;/p&gt;

&lt;p&gt;That all sound cool but why bother yourself with learning and implement this concept? The thing that’s if you do this, your code will be much cleaner, more readable, working with code that split into tiny pieces will be much easier.&lt;br&gt;
Let’s take some examples.&lt;/p&gt;

&lt;p&gt;We have some component, like the header of a website if we do it old way it looks like that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gybsHDmA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tqyv2dklj6jh5wzsu7wf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gybsHDmA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tqyv2dklj6jh5wzsu7wf.png" alt="the main component built the old way"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Relatively hard to read all this stuff and think about new features, isn’t it? And it is just JSX murk up, without any interactivity. But what if we slice it to smaller parts.&lt;/p&gt;

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

&lt;p&gt;Here we cut out the navigation part of markup and move it to a separate component.&lt;/p&gt;

&lt;p&gt;And here we move our form in a separate file as well. &lt;/p&gt;

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

&lt;p&gt;The parent component looks like that right now. I also make a separate component for the logo and place it inside the parent component. It's another way to isolate code chunks and make the development process easier. &lt;/p&gt;

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

&lt;p&gt;See how much cleaner code became, and now for us it’s easier to work with. It’s doing the same thing but all the parts are separated. Even if we add interactivity or state and state management to this, all the components will still much easier to maintain and modify.&lt;/p&gt;

&lt;p&gt;But that not all. Your components can be used anywhere across the app and even can be put into the library or as npm packages and be used in other your projects. If you keep in mind, eventually you will start to build your components to use it across your app and other projects as well.&lt;/p&gt;

&lt;p&gt;Wrapping things up. Components are the core concept of the React library. They provide the ability to divide our code into smaller parts for much faster development features and keep all the things smaller and reusable.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Add background to styled-components while use ".map" method</title>
      <dc:creator>Vladislav Kresov</dc:creator>
      <pubDate>Mon, 13 Jan 2020 15:44:31 +0000</pubDate>
      <link>https://dev.to/hellvinter/add-background-to-styled-components-while-use-map-method-45kk</link>
      <guid>https://dev.to/hellvinter/add-background-to-styled-components-while-use-map-method-45kk</guid>
      <description>&lt;p&gt;Hi everyone, it's my first post on DEV!&lt;/p&gt;

&lt;p&gt;Two days ago I hit a small problem, but still, that took time to solve it.&lt;/p&gt;

&lt;p&gt;I decide to write a little post about it for future me and maybe someone who will meet the same issue. I hope it will be helpful and save some time for someone!&lt;/p&gt;

&lt;p&gt;The thing that I should do, was to display different background on a couple of divs while using styled-components and map method. I try to pass the background as property but it didn't work. I think the reason behind that is either me who pass prop incorrectly, or props in the first place wouldn't work in that case? It doesn't matter cause I came up with another solution.&lt;/p&gt;

&lt;p&gt;It's inline styles. I dunno how much the performance unfriendly and I sure that a better solution exists, but if you struggle with the same problem and yet don't find a solution, I hope my small code example would help you!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nK_GwDIh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xqh1gkzydp39yx9c0ruo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nK_GwDIh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xqh1gkzydp39yx9c0ruo.png" alt="Code Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for attention.&lt;/p&gt;

&lt;p&gt;Edit note. You should use camelCase property when to write inline styles like "backgroundSize". I forget that when write example code. Sorry.  &lt;/p&gt;

</description>
      <category>react</category>
      <category>styledcomponents</category>
    </item>
  </channel>
</rss>
