Giter Site home page Giter Site logo

aisyachalvinaizumi-web-reactku's Introduction

Week2: ReactJs2

Practicum Report

Adding React to the website

  1. Make a folder learn-react/week-2/web-react
  2. Create index.html file
  • Code Implementation:

img

  1. create a js file with the name like_button.js
  • Code Implementation:

img

  1. Open the index.html file in your browser
  • Result: At first, there is no “Like” button below the Hello World, then I re-check the code. And I found out there is an error in the fuction declaration. And I fixed it.

img

  • And it works like this.

img

img

React-app Installation

  1. Specify the location to install react, for example on windows C:\react (create the folder if it doesn't already exist, by using CMD or DOS.
  • If the position is already in the folder, type the following command: npm install -g create-react-app.
  • Then, I found a warning that my tar version is no longer supported.

img

  • So I updated the tar with the command : npm install tar@6 -g. and it works like this.

img

  • check whether the installation was successful or not, type the following command: create-react-app --version

img

  • Then, I execute the defined file with this command’s one by one:
  • create-react-app web-reactku

img

  • cd web-reactku

img

  • npm start

img

  • it will automatically open a web page with the address localhost:3000.

img

  • I open the folder with VS Code.

img

  • And I try to run it, in Terminal:

img

  • The browser will automatically open. It will display the same way as before, because there is no any change yet.

img

Creating Hello Components Using Arrow Function

  1. Open the index.js file in src and add an arrow function with the name Hello

img img

  1. Run and open your browser

img

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.