Git Product home page Git Product logo

react_concepts's Introduction

Getting Started with Create React App

This project was bootstrapped with Create React App.

You can run CRA by using npm start

Main Concepts of React.js

Brief doc of main concept of React.js (JSX, Props, State)

JSX

JSX는 JavaScript+XML의 합성어로, JS에 HTML태그를 끼얹은 문법입니다.

HTML 태그 안에서 중괄호 { } (*destucting문법)를 사용해서 JS를 활용할 수 있다.

Usage

function App () {
    const number = 5;
    return(
        <b>{number}입니다.</b>
    )
}
export default App; //index.js에서 import

📌React에서는 App.js최상위 컴포넌트로 관례상 간주하고 있습니다. 그래서 index.js를 최상위 컴포넌트로 구현하진 않습니다.

State

컴포넌트 안에서 자유롭게 변경할 값이 필요할때 사용합니다.

  • useState(초기값) : 매개변수로 초기값을 전달 받습니다
  • const[상태명, set함수명] = React.useState(초기값) : 상태명: 값 리턴 , set함수명: count값을 변화시키는 상태 변화 함수

Props

컴포넌트 간 데이터를 전달 시에는 props를 활용합니다.

주로 컴포넌트의 매개변수props로 받으며 컴포넌트 간 렌더링이 일어납니다.

자세한 예제 (src 폴더 내)

  1. App.js - Counter.jscounterProps 코드
  2. App.js - Container.jschildren 코드

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

react_concepts's People

Contributors

dobyming avatar

Watchers

 avatar

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.