<?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: diiiiana99</title>
    <description>The latest articles on DEV Community by diiiiana99 (@diiiiana99).</description>
    <link>https://dev.to/diiiiana99</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%2F806451%2F773b1217-12fd-4803-8de2-9827b5f35cbd.jpg</url>
      <title>DEV Community: diiiiana99</title>
      <link>https://dev.to/diiiiana99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/diiiiana99"/>
    <language>en</language>
    <item>
      <title>Rails API User Authentication in React A detailed tutorial on Rails/React user authentication</title>
      <dc:creator>diiiiana99</dc:creator>
      <pubDate>Mon, 09 May 2022 17:51:58 +0000</pubDate>
      <link>https://dev.to/diiiiana99/connecting-javascript-react-and-ruby-on-rails-user-authentication-and-authorization-2le3</link>
      <guid>https://dev.to/diiiiana99/connecting-javascript-react-and-ruby-on-rails-user-authentication-and-authorization-2le3</guid>
      <description>&lt;p&gt;API for Rails&lt;br&gt;
Let's begin by establishing the API that will be used to authenticate our users in our react app.&lt;/p&gt;

&lt;p&gt;Prerequisites&lt;br&gt;
Please make sure the following are installed on your computer before beginning this portion of the course. This will make it easier for you to follow along without any problems.&lt;/p&gt;

&lt;p&gt;Rails &amp;gt;= 6.0 should be installed.&lt;br&gt;
Install PostgreSQL and set it up. Installers for Ubuntu may be found here.&lt;br&gt;
Install your preferred text editor.&lt;br&gt;
Rails new auth-api —api -d=postgresql creates a new Rails app. This script builds a new API Rails app called auth-api with the database Postgresql. Change to the app directory; cd auth-api&lt;/p&gt;

&lt;p&gt;Construct a User model.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

rails g model User email, password_digest



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

&lt;/div&gt;

&lt;p&gt;Now let's create the database and migrate the schema.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Runrails db:create and rails db:migrate


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

&lt;/div&gt;

&lt;p&gt;Update Gemfile&lt;br&gt;
Add gem 'bcrypt' and gem 'racks-cors', :require =&amp;gt; 'racks/cors'&lt;/p&gt;

&lt;p&gt;Install the gems by running &lt;code&gt;bundle install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Set up the session storage.&lt;br&gt;
The user's session will be saved across the app using this file settings.&lt;/p&gt;

&lt;p&gt;Create a file called session store.rb in config/initializers.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

if Rails.env == "production"
  Rails.application.config.session_store :cookie_store, key: "_authentication_app", domain: "https://link-to-your-production-app.com/"
else
  Rails.application.config.session_store :cookie_store, key: "_authentication_app"
end


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

&lt;/div&gt;

&lt;p&gt;Let's set up the CORS middleware (Cross-Origin Resource Sharing).&lt;br&gt;
CORS (Cross-Origin Resource Sharing) is a method that uses extra HTTP headers to instruct browsers to allow a web application operating on one origin to access resources from another origin. When a web application accesses a resource from a domain, protocol, or port other than its own, it makes a cross-origin HTTP request. Find out more here.&lt;/p&gt;

&lt;p&gt;Inside config/initializers, create the file cors.rb and paste the code below into it.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Rails.application.config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins "http://localhost:3000"
    resource "*", headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head], credentials: true
  end

  allow do
    origins "https://link-to-production-app.com/"
    resource "*", headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head], credentials: true
  end
end



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

&lt;/div&gt;

&lt;p&gt;Create the sessions controller&lt;br&gt;
rails g controller Sessions&lt;/p&gt;

&lt;p&gt;app/controllers/sessions_controller&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

class SessionsController &amp;lt; ApplicationController
  include CurrentUserConcern

  def create
    user = User.find_by(email: params["user"]["email"]).try(:authenticate, params["user"]["password"])

    if user
      session[:user_id] = user.id 
      render json: {
        status: :created,
        logged_in: true,
        user: user
      }
    else
      render json: { status: 401 }
    end
  end

  def logged_in
    if @current_user
      render json: {
        logged_in: true,
        user: @current_user
      }
    else
      render json: {
        logged_in: false
      }
    end
  end

  def logout
    reset_session
    render json: { 
      status: 200, 
      logged_out: true 
    }
  end
end


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

&lt;/div&gt;

&lt;p&gt;Add the user's current worry.&lt;br&gt;
Create a new file current user concern.rb in the app/controllers/concerns folder and add the following code to it.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


module CurrentUserConcern
  extend ActiveSupport::Concern

  included do
    before_action :set_current_user
  end

  def set_current_user
    if session[:user_id]
      @current_user = User.find(session[:user_id])
    end
  end
end


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

&lt;/div&gt;

&lt;p&gt;The current user concern variable will be used to identify logged-in app users. We made it a worry so that other controllers could access it. Continue reading.&lt;/p&gt;

&lt;p&gt;Editing the User Model&lt;br&gt;
Add the line has secure password to app/models/user.rb. That line is required for bcrypt to encrypt our user passwords.&lt;/p&gt;

&lt;p&gt;Add validation to the model as well&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

class User &amp;lt; ApplicationRecord
  has_secure_password
  validates_presence_of :email, :password
  validates_uniqueness_of :email
end


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

&lt;/div&gt;

&lt;p&gt;Update our routes&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Rails.application.routes.draw do
  resources :sessions, only: [:create]
  resources :users

  delete :logout, to: "sessions#logout"
  get :logged_in, to: "sessions#logged_in"

  root to: "static#home"
end


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

&lt;/div&gt;

&lt;p&gt;Let's make the registrations controller for new user registration.&lt;br&gt;
Let's provide our new users the chance to register now that our software is operating as planned.&lt;/p&gt;

&lt;p&gt;Create the registrations controller.rb file in app/controllers.&lt;/p&gt;

&lt;p&gt;Registrations for rails g controller&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

class RegistrationsController &amp;lt; ApplicationController
  def create 
    user = User.create!(
      email: params["user"]["email"],
      password: params["user"]["password"],
      password_confirmation: params["user"]["password_confirmation"]
    )

    if user 
      session[:user_id] = user.id 
      render json: {
        status: :created,
        user: user
      }
    else
      render json: { status: 500 }
    end
  end
ens


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

&lt;/div&gt;

&lt;p&gt;Update the Application controller&lt;br&gt;
Open app/controllers/application_controller.rb and change it to&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

class ApplicationController &amp;lt; ActionController::Base
  skip_before_action :verify_authenticity_token
end


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

&lt;/div&gt;

&lt;p&gt;The line skip before action:verify authenticity token disables the controllers' forgery prevention. This is critical for resolving the ActionController:: Exceptions for InvalidCrossOriginRequest. More information may be found here.&lt;/p&gt;

&lt;p&gt;The Rails portion of the application is now complete. Let's perform one more test by creating a user from the console to ensure that our model is functioning properly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fedqq7d963vpd7y9hda9o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fedqq7d963vpd7y9hda9o.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;App in Reactjs&lt;br&gt;
It's time to develop the Reactjs app and connect it to our Rails backend now that we've finished configuring the Rails API.&lt;/p&gt;

&lt;p&gt;Prerequisites&lt;br&gt;
Before proceeding, make sure you have the following installed and functioning on your computer.&lt;/p&gt;

&lt;p&gt;Nodejs. Installers for Ubuntu may be found here.&lt;/p&gt;

&lt;p&gt;Make a react app&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;npx create-react-app name-of-app&lt;/code&gt; . This creates a new react app with the name chosen.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;npm start&lt;/code&gt; to ensure everything is working properly. If you built your app correctly, you should see this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F875jmmudv7wsp3j0xbd5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F875jmmudv7wsp3j0xbd5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create components &lt;br&gt;
Let's install some packages that we'll use later before we start building our first component. &lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;npm install --save react-route react-router react-router-dom axios&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;React-route will be used to generate our routes, &lt;code&gt;axios&lt;/code&gt; will be used to communicate with our Rails API, and &lt;code&gt;react-router&lt;/code&gt; and &lt;code&gt;react-router-dom&lt;/code&gt; will be used to render the matching Route&amp;gt;.&lt;/p&gt;

&lt;p&gt;Open src and make two new folders called components and auth. Create a new file registration and move app.js to components. Add the following code to js in the auth folder.&lt;/p&gt;

&lt;p&gt;Open src and make two new folders called components and auth. Create a new file registration and move app.js to components. Add the following code to js in the auth folder:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import React, { Component } from "react";
import axios from "axios";
import { Link } from "react-router-dom";

export default class Registration extends Component {
  constructor(props) {
    super(props);

    this.state = {
      email: "",
      password: "",
      password_confirmation: "",
      registrationErrors: ""
    };
    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleChange = this.handleChange.bind(this);
  }

  handleSubmit(event) {
    const {
      email,
      password,
      password_confirmation
    } = this.state;
    axios
      .post(
        "http://localhost:3001/users",
        {
          user: {
            email: email,
            password: password,
            password_confirmation: password_confirmation
          }
        },
        { withCredentials: true }
      )
      .then(response =&amp;gt; {
        if (response.data.status === "created") {
          console.log("Registration data", response.data)
        }
      })
      .catch(error =&amp;gt; {
        console.log("registration error", error);
      });

    event.preventDefault();
  }

  handleChange(event) {
    this.setState({
      [event.target.name]: event.target.value
    });
  }

  render() {
    return (
      &amp;lt;div&amp;gt;
        &amp;lt;form onSubmit={this.handleSubmit}&amp;gt;
          &amp;lt;div className="form-group"&amp;gt;
            &amp;lt;input
              className="form-control"
              type="email"
              name="email"
              placeholder="Email"
              required
              value={this.state.email}
              onChange={this.handleChange}
            /&amp;gt;
          &amp;lt;/div&amp;gt;

          &amp;lt;div className="form-group"&amp;gt;
            &amp;lt;input
              className="form-control"
              type="password"
              name="password"
              placeholder="Password"
              required
              value={this.state.password}
              onChange={this.handleChange}
            /&amp;gt;
          &amp;lt;/div&amp;gt;

          &amp;lt;div className="form-group"&amp;gt;
            &amp;lt;input
              className="form-control"
              type="password"
              name="password_confirmation"
              placeholder="Password Confirmation"
              required
              value={this.state.password_confirmation}
              onChange={this.handleChange}
            /&amp;gt;
          &amp;lt;/div&amp;gt;

          &amp;lt;button type="submit" className="btn btn-primary btn-sm"&amp;gt;
            Register
          &amp;lt;/button&amp;gt;
          &amp;lt;p&amp;gt;
            Have an account? &amp;lt;Link to="/"&amp;gt;Login&amp;lt;/Link&amp;gt;
          &amp;lt;/p&amp;gt;
        &amp;lt;/form&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}


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

&lt;/div&gt;

&lt;p&gt;To begin, we construct a state object containing the parameters we require from a user in order to register successfully. Only the email, password, and password confirmation parameters are supported by our API.&lt;/p&gt;

&lt;p&gt;Our handleSubmit method will use axios to send a POST request to the API when the form is submitted. If the user's credentials are legitimate, a successful login will transport them to the dashboard, and their login status will be updated to logged in.&lt;/p&gt;

&lt;p&gt;The login.js component should now be added to the auth subdirectory.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import React, { Component } from "react";
import axios from "axios";

export default class Login extends Component {
  constructor(props) {
    super(props);

    this.state = {
      email: "",
      password: "",
      loginErrors: ""
    };
    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleChange = this.handleChange.bind(this);
  }

  handleSubmit(event) {
    const { email, password } = this.state;
    axios
      .post(
        "http://localhost:3001/sessions",
        {
          user: {
            email: email,
            password: password
          }
        },
        { withCredentials: true }
      )
      .then(response =&amp;gt; {
        if (response.data.logged_in &amp;amp;&amp;amp; response.data.patient) {
          this.props.handleSuccessfulAuth(response.data);
        } else {
          this.props.handleSuccessfulDoctorAuth(response.data);
        }
      })
      .catch(error =&amp;gt; {
        console.log("login error", error);
      });

    event.preventDefault();
  }

  handleChange(event) {
    this.setState({
      [event.target.name]: event.target.value
    });
  }

  render() {
    return (
      &amp;lt;div&amp;gt;
        &amp;lt;form onSubmit={this.handleSubmit}&amp;gt;
          &amp;lt;div className="form-group"&amp;gt;
            &amp;lt;input
              className="form-control"
              type="email"
              name="email"
              placeholder="Email"
              required
              value={this.state.email}
              onChange={this.handleChange}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div className="form-group"&amp;gt;
            &amp;lt;input
              className="form-control"
              type="password"
              name="password"
              placeholder="Password"
              required
              value={this.state.password}
              onChange={this.handleChange}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;button type="submit" className="btn btn-primary btn-sm"&amp;gt;
            Login
          &amp;lt;/button&amp;gt;
        &amp;lt;/form&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}


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

&lt;/div&gt;

&lt;p&gt;We have our login and registration components ready at this stage. So let's get started.&lt;/p&gt;

&lt;p&gt;The Dashboard and Home components&lt;br&gt;
For unauthenticated users, we require a home component, and for authorized users, we need a dashboard component.&lt;/p&gt;

&lt;p&gt;A login form and a link to register will be on the main page. After logging in, users are brought to the dashboard, where they can logout.&lt;/p&gt;

&lt;p&gt;Add home.js to src/components to build the home component.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import React, { Component } from "react";
import Login from "./auth/Login";
import { Link } from "react-router-dom";

export default class Home extends Component {
  constructor(props) {
    super(props);
    this.handleSuccessfulAuth = this.handleSuccessfulAuth.bind(this);
  }

  handleSuccessfulAuth(data) {
    this.props.handleLogin(data);
    this.props.history.push("/dashboard");
  }

  render() {
    return (
      &amp;lt;div&amp;gt;
        &amp;lt;h1&amp;gt;Home&amp;lt;/h1&amp;gt;
        &amp;lt;h1&amp;gt;Status: {this.props.loggedInStatus}&amp;lt;/h1&amp;gt;
        &amp;lt;Login
          handleSuccessfulAuth={this.handleSuccessfulAuth}
        /&amp;gt;
        &amp;lt;p&amp;gt;
          Don't have an account? &amp;lt;Link to="/registration"&amp;gt;Register&amp;lt;/Link&amp;gt;
        &amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}


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

&lt;/div&gt;

&lt;p&gt;The App component&lt;br&gt;
The App component is the topmost (parent) component.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import React, { Component } from "react";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import Dashboard from "./dashboard";
import Home from "./home";
import axios from "axios";
import "bootstrap/dist/css/bootstrap.min.css";
import Registration from "../auth/Registration";

export default class App extends Component {
  constructor() {
    super();

    this.state = {
      loggedInStatus: "NOT_LOGGED_IN"
    };

    this.handleLogin = this.handleLogin.bind(this);
    this.handleLogout = this.handleLogout.bind(this);
    this.handleSuccessfulAuth = this.handleSuccessfulAuth.bind(this);
  }

  checkLoginStatus() {
    axios
      .get("http://localhost:3001/logged_in", { withCredentials: true })
      .then(response =&amp;gt; {
        if (
          response.data.logged_in &amp;amp;&amp;amp;
          this.state.loggedInStatus === "NOT_LOGGED_IN"
        ) {
          this.setState({
            loggedInStatus: "LOGGED_IN"
          });
        } else if (
          !response.data.logged_in &amp;amp;&amp;amp;
          this.state.loggedInStatus === "LOGGED_IN"
        ) {
          this.setState({
            loggedInStatus: "NOT_LOGGED_IN"
          });
        }
      })
      .catch(error =&amp;gt; {
        console.log("login error", error);
      });
  }

  handleSuccessfulAuth(data) {
    this.handleLogin(data);
  }

  componentDidMount() {
    this.checkLoginStatus();
  }

  handleLogin(data) {
    this.setState({
      loggedInStatus: "LOGGED_IN"
    });
  }

  handleLogout() {
    this.setState({
      loggedInStatus: "NOT_LOGGED_IN"
    });
  }

  render() {
    return (
      &amp;lt;div className="app"&amp;gt;
        &amp;lt;BrowserRouter&amp;gt;
          &amp;lt;Switch&amp;gt;
            &amp;lt;Route
              exact
              path={"/"}
              render={props =&amp;gt; (
                &amp;lt;Home
                  {...props}
                  loggedInStatus={this.state.loggedInStatus}
                  handleLogin={this.handleLogin}
                  handleLogout={this.handleLogout}
                /&amp;gt;
              )}
            /&amp;gt;
            &amp;lt;Route
              exact
              path={"/dashboard"}
              render={props =&amp;gt; (
                &amp;lt;Dashboard
                  {...props}
                  loggedInStatus={this.state.loggedInStatus}
                /&amp;gt;
              )}
            /&amp;gt;
            &amp;lt;Route
              exact
              path={"/registration"}
              render={props =&amp;gt; (
                &amp;lt;Registration
                  handleSuccessfulAuth={this.handleSuccessfulAuth}
                  {...props}
                  loggedInStatus={this.state.loggedInStatus}
                /&amp;gt;
              )}
            /&amp;gt;
          &amp;lt;/Switch&amp;gt;
        &amp;lt;/BrowserRouter&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}


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

&lt;/div&gt;

&lt;p&gt;At this stage, we must test our app to check how it functions.&lt;/p&gt;

&lt;p&gt;Let's get the servers up and running: reactjs server; npm start This will run the program on port 3000 automatically.&lt;/p&gt;

&lt;p&gt;rails s -p 3001 rails server&lt;/p&gt;

&lt;p&gt;Home/Login Page&lt;br&gt;
Let's utilize the user credentials we established while we were testing the user model to log in.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Getting Started with React Native for Beginners from a Beginner's Experience</title>
      <dc:creator>diiiiana99</dc:creator>
      <pubDate>Sun, 03 Apr 2022 23:55:23 +0000</pubDate>
      <link>https://dev.to/diiiiana99/getting-started-with-react-native-for-beginners-from-a-beginners-experience-1mkn</link>
      <guid>https://dev.to/diiiiana99/getting-started-with-react-native-for-beginners-from-a-beginners-experience-1mkn</guid>
      <description>&lt;p&gt;React Native is a versatile framework that makes creating mobile apps a breeze. Because of its simplicity, developers have been able to construct a variety of tools, kits, and templates to work with, each with its own unique purpose. &lt;/p&gt;

&lt;p&gt;It was simple for me to get started with React Native, and I'll do my best to explain it to you. It will be lot easier for you if you are a Web developer, as I previously stated. Node.js and Node Package Manager (NPM) are required for React Native, as well as Code Editor and Expo. &lt;br&gt;
Is that it? Yes.&lt;/p&gt;

&lt;p&gt;Don't worry if you don't understand something; I'm here to assist you.&lt;/p&gt;

&lt;p&gt;1) You've installed both Node.js and NPM once you've installed Node.js (Node Package manager). NPM stands for Node Package Manager. As a result, there's no need to download it. &lt;br&gt;
Now is the time to get started with React Native. Open a command window and run the following command to install React Native globally. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;install -g npm create-react-native-app &lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Using NPM, this command installs the React Native package globally(-g). It can be installed in any directory of your choice. &lt;br&gt;
You can also learn more about it by going to React Native setting up the development environment. &lt;br&gt;
It's a straightforward Facebook tutorial for making a react-native app. &lt;br&gt;
After you've installed it, you can use VS Code or any other code editor to write code. &lt;/p&gt;

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

&lt;p&gt;2)React Native's Operation:&lt;br&gt;
For experienced mobile developers, the most unexpected aspect of React Native is that it is truly native. &lt;br&gt;
A Cordova library or a framework built on top of it, such as Ionic, is used by the majority of popular solutions for developing mobile applications using JavaScript. You'll have access to native APIs using Cordova, but the heart of your app will be HTML and JavaScript rendered in a WebView. &lt;br&gt;
While it is possible to achieve the appearance and feel of the native UI in this manner, every Cordova application will suffer from performance issues, which is especially true for graphically intensive apps and the Android platform as a whole. This will result in a poor user experience and dissatisfied customers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S3U6NNLR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jv8pd01hb68tmctiac8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S3U6NNLR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jv8pd01hb68tmctiac8.png" alt="Image description" width="880" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3)Styling:&lt;br&gt;
CSS syntax, which is written in JavaScript objects, is used to finish styling components. React Native employs a subset of Flexbox to build the layout, which is an efficient approach to divide space between components in a container. The style prop is accepted by all of the library's basic components. The style names are camelCased, e.g. marginLeft, which is a notable contrast from CSS on the web. The adoption of a Stylesheet is an excellent strategy. create method, which simplifies the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--55otsvhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5g3iyijydvaurzyaez1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--55otsvhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5g3iyijydvaurzyaez1.png" alt="Image description" width="880" height="681"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4)Benefits of Using React Native:&lt;/p&gt;

&lt;p&gt;The application has a shared codebase thanks to React Native. According to Facebook's Ad Manager software, code repetition is at 87 percent, which is a staggering figure. &lt;br&gt;
Another excellent feature is that you can easily import platform-specific components into the application if your team need one. The Platform module can be used to add specific components to the program by detecting the platform on which it is running.&lt;/p&gt;

&lt;p&gt;5)Developer Experience that is Better and Smoother:&lt;/p&gt;

&lt;p&gt;From the developer's perspective, one of the biggest arguments for designing a React Native app is that, unlike traditional iOS and Android development, React Native apps can be "instantly" updated without having to rebuild. Error reporting is also pretty good, and Chrome Developer Tools can be used to debug JavaScript code. Furthermore, because JavaScript is transpiled, the developer has access to all of the language's new capabilities, which might increase productivity. &lt;/p&gt;

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

&lt;p&gt;6)Efficiency:&lt;/p&gt;

&lt;p&gt;Quick prototyping and a high initial velocity are possible with React Native. Basic functionalities are simple to implement, and they can be expanded with native code and native views if necessary.&lt;/p&gt;

&lt;p&gt;Takeaways &lt;br&gt;
React Native is a relatively new technology that has quickly gained popularity. It boosts developer productivity, is scalable, and has the potential to save enterprises time and money.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is Ruby and Ruby methods that I found challenging?</title>
      <dc:creator>diiiiana99</dc:creator>
      <pubDate>Mon, 14 Mar 2022 14:23:24 +0000</pubDate>
      <link>https://dev.to/diiiiana99/what-is-ruby-and-ruby-methods-that-i-found-challenging-215d</link>
      <guid>https://dev.to/diiiiana99/what-is-ruby-and-ruby-methods-that-i-found-challenging-215d</guid>
      <description>&lt;p&gt;In previous blog postings, I discussed how difficult it was for me to understand and apply the material. Well, in comparison to the others, I'd say this step was the most difficult. This step necessitated a great deal of concentration, repetition, and, most importantly, perseverance. I'm happy to report that I made it through the ordeal and learnt a lot! In this blog, I will be discussing how Ruby methods are structured and implemented, as well as the strategy I followed to better understand them!&lt;/p&gt;

&lt;p&gt;Active Record Methods was the subject on which I spent the most time studying. At first, I thought that writing these methods would be simple. It was in certain circumstances! It didn't take me long to figure out simple ways like retrieving an ordered list of instances or finding a single instance by a certain key. When I started learning more advanced techniques, such as identifying the most popular instance of a class or employing helper methods within other methods, I became frustrated. That's when I started having problems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xNEcKbNB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0j1hwl3muo175opiuypc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xNEcKbNB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0j1hwl3muo175opiuypc.png" alt="Image description" width="520" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This strategy was unquestionably difficult to implement appropriately. Figuring out what my end result needs to be and then thinking about all of the various steps/code it might take to get there was one of the most beneficial abilities I utilized to go through this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8B4OnPhU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqlc4b35dpqgzid67a8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8B4OnPhU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqlc4b35dpqgzid67a8f.png" alt="Image description" width="298" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The helper method I utilized in the most popular method to help me get to my ultimate result is shown here. Originally, this method was used to determine the number of books written in a given genre. The wonderful thing about some of these simple techniques is that they can help simplify the code for more sophisticated ones. If you look at the first snip, you'll see what I mean. In the first line of code, you can see how this helper method is used. The first line of code is in charge of calculating the total number of books in each genre and returning them as an array in the books total variable.&lt;/p&gt;

&lt;p&gt;The total number of books for each genre instance is calculated using my book count function. The second line of code locates the index with the largest books total value and saves it to the idx variable. The final line of code loops through the whole array of genre instances and returns the genre that was discovered and saved in the idx variable. &lt;/p&gt;

&lt;p&gt;It's critical to approach these types of approaches line by line, paying great attention to what each line will yield and how that will help you get closer to your desired final result. Solving them became lot easy once I started thinking about each strategy in this way!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How Learning React Improved My Skills in JS.</title>
      <dc:creator>diiiiana99</dc:creator>
      <pubDate>Thu, 24 Feb 2022 22:18:12 +0000</pubDate>
      <link>https://dev.to/diiiiana99/how-learning-react-improved-my-skills-in-js-327f</link>
      <guid>https://dev.to/diiiiana99/how-learning-react-improved-my-skills-in-js-327f</guid>
      <description>&lt;p&gt;For me, this phase has been a whole journey and a massive learning experience. &lt;br&gt;
There were a lot of topics I wanted to write about... &lt;/p&gt;

&lt;p&gt;It was a lot easier to understand and use ReactJS than it was JS.  As a beginner developer with a JavaScript experience, it took some time to learn React and start building web apps in a matter of days. It's the V(view part) of the MVC (Model-View-Controller) model, and it's also known as a JavaScript framework. Although, React isn't completely featured, but it benefited me from the open-source JavaScript User Interface(UI) module, which aids in task execution. &lt;br&gt;
The most difficult part for me was figuring out how to locate and render a single review. &lt;/p&gt;

&lt;p&gt;At first, it was difficult to construct a dynamic web application with HTML strings since it required extensive coding, but React JS eliminated that problem and made it so much easier which made fall in love with the language. It requires less coding while providing more features which is every developers' dream, let's be honest ;). First thing that I learned that React uses the JSX (JavaScript Extension) syntax, which is a special grammar that allows HTML quotes and HTML tag syntax to render certain subcomponents. It also allows you to create machine-readable codes.&lt;/p&gt;

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

&lt;p&gt;A ReactJS web application consists of several components, each with its own logic and controls which was the part I liked the most and took the longest to have that "aha" moment. These components are in charge of producing a short, reusable piece of HTML code that you may use anywhere you need it. As I progressed and moved forward, it clicked to me that reusable code makes it easy to develop and maintain my apps. These Components can be stacked with one other to create sophisticated applications from simple building blocks. Moreover, I figured that in order to populate data in the HTML DOM, ReactJS uses a virtual DOM-based technique which was very interesting to learn. The virtual DOM is quick because it simply modifies individual DOM elements rather than reloading the entire DOM every time: &lt;/p&gt;

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

&lt;p&gt;Lastly, as I understood, the majority of web developers are now using ReactJS because of its benefits that make our tasks easier to divide to its own thing but also connect them with functionalities and UI engagement because it comes with a large JavaScript library. Web developers like ourselves have more freedom with the JavaScript library since we can use it in whatever way we wish. In addition, testing ReactJS applications is a breeze. It provides a platform for developers to test and debug their programs using native tools. At the end,I was very happy that I was able to tackle the fundamentals of React and even more eager to dive in deeper to create awesome projects.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Job In Tech That Requires No Coding Skills.</title>
      <dc:creator>diiiiana99</dc:creator>
      <pubDate>Sun, 30 Jan 2022 23:03:40 +0000</pubDate>
      <link>https://dev.to/diiiiana99/a-job-in-tech-that-requires-no-coding-skills-4h2c</link>
      <guid>https://dev.to/diiiiana99/a-job-in-tech-that-requires-no-coding-skills-4h2c</guid>
      <description>&lt;p&gt;What Is Software Project Management and How Does It Work? &lt;/p&gt;

&lt;p&gt;The planning, scheduling, resource allocation, execution, tracking, and delivery of software and web projects are all part of software project management. &lt;/p&gt;

&lt;p&gt;Software engineering project management differs from typical project management in that software projects have a specific life cycle process that necessitates numerous rounds of testing, updating, and user input. To keep up with the increasing pace of business and iterate depending on customer and stakeholder feedback, most IT-related projects are handled in an Agile manner.&lt;/p&gt;

&lt;p&gt;Software Project Management Benefits: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It aids in software development planning. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software development is made simple to implement. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Software project management includes issues such as monitoring and regulating. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overall, it reduces the amount of time and money spent on software development.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I personally believe that PM positions are the crucial part of every management team. They bring developers, creatives, QAs, product developers together and manage the final product for UX. &lt;/p&gt;

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