<?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: Rahul Kumar Choudhary</title>
    <description>The latest articles on DEV Community by Rahul Kumar Choudhary (@rkc98).</description>
    <link>https://dev.to/rkc98</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%2F684090%2F95b55e22-5962-407c-8370-013b8d8eebe6.png</url>
      <title>DEV Community: Rahul Kumar Choudhary</title>
      <link>https://dev.to/rkc98</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rkc98"/>
    <language>en</language>
    <item>
      <title>Adding Dynamic Css Background Image Using Styled Components In React</title>
      <dc:creator>Rahul Kumar Choudhary</dc:creator>
      <pubDate>Mon, 04 Oct 2021 02:10:17 +0000</pubDate>
      <link>https://dev.to/rkc98/adding-dynamic-css-background-image-using-styled-components-in-react-3eod</link>
      <guid>https://dev.to/rkc98/adding-dynamic-css-background-image-using-styled-components-in-react-3eod</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import styled from "styled-components";


const Home=()=&amp;gt;{
return ( 
&amp;lt;Wrap backgroundImage={backgroundImage}&amp;gt; 
&amp;lt;/Wrap&amp;gt;
)
}


const Wrap = styled.div`
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: ${(props) =&amp;gt;
    `url(${require(`../images/${props.backgroundImage}`).default})`};
  display: flex;
  flex-direction: column;
  justify-content: space-between; //vertical alignment because of flex direction column
  align-items: center; //horizontal alignment because of flex direction column
`;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>css</category>
      <category>javascript</category>
      <category>styledcomponent</category>
    </item>
  </channel>
</rss>
