본문 바로가기
STUDY/React

[37일차] 리액트 200제

by GWLEE 2022. 8. 11.

🤎2022-08-11🤎

 

 

 

https://nodejs.org/download/release/v14.4.0/

 

 

Index of /download/release/v14.4.0/

 

nodejs.org

 

node.js

node-v14.4.0-x64.msi 파일 다운

 

입문 03

 

App.css

.App {
  text-align: center;
}

.App-logo {
  height: 40vmin;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .App-logo {
    animation: App-logo-spin infinite 20s linear;
  }
}

.App-header {
  background-color: #282c34;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
}

.App-link {
  color: #61dafb;
}

div {
  background-color: rgb(162, 127, 243);
  color: rgb(255, 255, 255);
  padding: 40px;
  font-family: 고딕;
  text-align: center;
}

h1 {
  color: white;
  background-color: #2EFE2E;
  padding: 10px;
  font-family: 궁서;
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

 

 

App.js

import React from 'react';
import './App.css';
import ImportConponent from './R003_ImportConponent'

function App() {
  return (
    <div>
      <h1>Start React 200!</h1>
      <p>HTML 적용하기</p>
      <ImportConponent></ImportConponent>
    </div>
  );
}

export default App;

 

R003_ImportConponent.js 

import React, { Component } from 'react';

class R003_ImportConponent extends Component{
  render (){
    return (
      <h2>[ThIS IS IMPORTED COMPONENT]</h2>
    )
  }
}

export default R003_ImportConponent;

 

 


입문 004

생명주기 함수 render() 사용하기

 

R004_LifecycleEx.js

import React, { Component } from 'react';

class R004_LifecycleEx extends Component {
  render() {
    console.log('3. render call');
    return (
      <h2>[THIS IS RENDER FUNCTION]</h2>
    )
  }
}

export default R004_LifecycleEx;

 

 

App.js

import React from 'react';
import './App.css';
import LifecycleEx from './R004_LifecycleEx'

function App() {
  return (
    <div>
      <h1>Start React 200!</h1>
      <p>HTML 적용하기</p>
      <LifecycleEx></LifecycleEx>
    </div>
  );
}

export default App;

 

 

 

'STUDY > React' 카테고리의 다른 글

React project..  (0) 2023.04.23
React  (0) 2023.04.16
1. react  (0) 2023.01.16
[39일차] 리액트 200제 6~10  (0) 2022.08.16

댓글