<?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: Anubrat Sahoo</title>
    <description>The latest articles on DEV Community by Anubrat Sahoo (@anxbt).</description>
    <link>https://dev.to/anxbt</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%2F1123842%2Ff8e8df67-3811-46e1-b367-2f51b6da48ae.jpeg</url>
      <title>DEV Community: Anubrat Sahoo</title>
      <link>https://dev.to/anxbt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anxbt"/>
    <language>en</language>
    <item>
      <title>Intro to React-native</title>
      <dc:creator>Anubrat Sahoo</dc:creator>
      <pubDate>Tue, 15 Aug 2023 07:40:51 +0000</pubDate>
      <link>https://dev.to/anxbt/intro-to-react-native-5egp</link>
      <guid>https://dev.to/anxbt/intro-to-react-native-5egp</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BVEwO3dk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szafwz51dhh2lug4bkc0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BVEwO3dk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szafwz51dhh2lug4bkc0.png" alt="Final Look our App" width="293" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be using expo to build our first app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--83CO-DoC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wsvjuxywdauswkr9vjet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--83CO-DoC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wsvjuxywdauswkr9vjet.png" alt="Image description" width="396" height="897"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;h3&gt;
  
  
  open up App.js clear all the code
&lt;/h3&gt;&lt;/li&gt;
&lt;li&gt;&lt;h3&gt;
  
  
  importing required dependencies
&lt;/h3&gt;&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Defining the Main component of our app
&lt;/h3&gt;


&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`export default function App() {
  return (
    // Outermost container that holds all other components
    &amp;lt;View style={styles.container}&amp;gt;
      {/* Nested View containing a piece of text */}
      &amp;lt;View&amp;gt;
        &amp;lt;Text&amp;gt;Another piece of text!&amp;lt;/Text&amp;gt;
      &amp;lt;/View&amp;gt;
      {/* Text component displaying "Hello World!" */}
      &amp;lt;Text&amp;gt;Hello World!&amp;lt;/Text&amp;gt;
      {/* Button component with title "Tap me!" */}
      &amp;lt;Button title='Tap me!' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}
const styles = StyleSheet.create({
});`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tMIcQWDV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6h1rwkydu33136wkldcu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tMIcQWDV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6h1rwkydu33136wkldcu.png" alt="Image description" width="398" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.###styling our App&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const styles = StyleSheet.create({
  // Styles for the outer container
  container: {
    flex: 1, // Take up the available space
    backgroundColor: 'pink', // Set background color to pink
    alignItems: 'center', // Align child components horizontally
    justifyContent: 'center', // Align child components vertically
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;###Final code
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StyleSheet, Text, View, Button } from 'react-native';
export default function App() {
  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;View&amp;gt;
        &amp;lt;Text&amp;gt;Another piece of text!&amp;lt;/Text&amp;gt;
      &amp;lt;/View&amp;gt;
    &amp;lt;Text&amp;gt;Hello World!&amp;lt;/Text&amp;gt;
      &amp;lt;Button title='Tap me!' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'pink',
    alignItems: 'center',
    justifyContent: 'center',
 },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Dockerize a React-JS app</title>
      <dc:creator>Anubrat Sahoo</dc:creator>
      <pubDate>Mon, 24 Jul 2023 12:15:02 +0000</pubDate>
      <link>https://dev.to/anxbt/dockerize-a-react-js-app-7ko</link>
      <guid>https://dev.to/anxbt/dockerize-a-react-js-app-7ko</guid>
      <description>&lt;p&gt;Create a file called "Dockerfile"&lt;/p&gt;

&lt;p&gt;then create another file called ".dockerignore"&lt;/p&gt;

&lt;p&gt;Then run the following commands in ur build&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker image ls&lt;/code&gt; =&amp;gt; to see all the images &lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build -t react-image .&lt;/code&gt; #To build  a image called "react-image"&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>docker</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
    <item>
      <title>React-JS Basics using funny analogies &amp; Counter app</title>
      <dc:creator>Anubrat Sahoo</dc:creator>
      <pubDate>Fri, 21 Jul 2023 04:38:14 +0000</pubDate>
      <link>https://dev.to/anxbt/react-js-basics-using-funny-analogies-counter-app-64b</link>
      <guid>https://dev.to/anxbt/react-js-basics-using-funny-analogies-counter-app-64b</guid>
      <description>&lt;h1&gt;
  
  
  We will be building this counter app &amp;amp; will be understanding the concepts simultaneously.
&lt;/h1&gt;

&lt;p&gt;`import React,{useState} from "react"&lt;br&gt;
import "./App.css"&lt;br&gt;
function App() {&lt;br&gt;
const[count,setCount]=useState(0);&lt;br&gt;
const[age,setage] = useState(0);&lt;/p&gt;

&lt;p&gt;const decreament = () =&amp;gt; {&lt;br&gt;
      setCount(count - 1)&lt;br&gt;
  };&lt;/p&gt;

&lt;p&gt;const increament = () =&amp;gt; {&lt;br&gt;
    setCount(count + 1)&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
     &lt;h1&gt; welcome to counter app&lt;/h1&gt;
&lt;br&gt;
   &lt;p&gt;The count is : {count}&lt;/p&gt;
&lt;br&gt;
   +&lt;br&gt;
    -&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
export default App;`
&lt;h3&gt;
  
  
  currently i will be focusing on important react concepts if u want a full code explanation scroll down the page
&lt;/h3&gt;

&lt;p&gt;import React,{useState} from "react"`&lt;/p&gt;

&lt;h2&gt;
  
  
  {useState} - it is an # hook
&lt;/h2&gt;

&lt;p&gt;Hooks:&lt;br&gt;
Hooks are like magic spells that help you use special powers with your box (state). With hooks, you can do cool things like adding more candies to your box, counting how many candies you have, or even changing the color of your toy house! The most popular hook in React is called "useState," and it lets you create and use that special box (state) in your app.&lt;/p&gt;

&lt;h3&gt;
  
  
  enitre code explanation
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`Imagine you have a whiteboard. On this whiteboard, you have two boxes. The first box is called "count," and the second box is called "age." These boxes represent the variables that hold some information in your app.&lt;/p&gt;

&lt;p&gt;Now, let's go through the code step by step:&lt;/p&gt;

&lt;p&gt;Import statements: In computer science, when you want to use some special tools or functions that are already created, you need to import them. It's like borrowing a specific tool from a toolbox. In this case, we are importing two things from the "react" library: "React" itself (which helps us create components) and "useState" (which is a special tool called a hook that allows us to manage state, as we'll see later).&lt;/p&gt;

&lt;p&gt;Function declaration: The code defines a function called "App." Functions are like sets of instructions that can be used whenever you need them. The "App" function is the starting point of our application.&lt;/p&gt;

&lt;p&gt;State and Hooks: In React, "state" is like a memory space where you can keep track of important information. Imagine you have a small drawer where you store something important. "useState" is a hook provided by React that gives you a way to create and manage state. Hooks are like special instructions to handle specific tasks in React.&lt;/p&gt;

&lt;p&gt;useState: The first "useState" hook is used to create a state variable called "count." It is initialized to 0 (the initial count value). The second "useState" hook is used to create a state variable called "age," which is also initialized to 0.&lt;/p&gt;

&lt;p&gt;Counting buttons: The code defines two functions: "decreament" and "increament." When you click the "-" button, the "decreament" function decreases the value of "count" by 1. When you click the "+" button, the "increament" function increases the value of "count" by 1.&lt;/p&gt;

&lt;p&gt;Rendering: React components are like instruction sheets for what should be shown on the screen. The "return" statement in the "App" function tells React what to display. In this case, it renders a div containing a header, a paragraph showing the current value of "count," and two buttons.&lt;/p&gt;

&lt;p&gt;Button Clicks: The buttons have "onClick" attributes that specify which function to call when they are clicked. So, when you click the "+" button, it calls the "increament" function, and when you click the "-" button, it calls the "decreament" function.&lt;/p&gt;

&lt;p&gt;Displaying count: The current value of "count" is displayed in the paragraph using curly braces and the "count" variable, like this: {count}. It's like showing the current value of the "count" box on the whiteboard.&lt;/p&gt;

&lt;p&gt;Overall, this React app is a simple counter that displays a number on the screen, and you can increase or decrease that number by clicking the buttons.&lt;/p&gt;

&lt;p&gt;Remember, React helps you build user interfaces in a structured and efficient way, and "state" and "hooks" are tools to manage data and make your app interactive.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
