From aa498f8ee969373d0d0481433d899e98add3896b Mon Sep 17 00:00:00 2001 From: haerong22 Date: Mon, 8 Mar 2021 02:32:44 +0900 Subject: [PATCH] react-redux : rendering --- react-redux/src/App.js | 3 ++- react-redux/src/Study.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 react-redux/src/Study.js diff --git a/react-redux/src/App.js b/react-redux/src/App.js index 1c50abe9..57b8922f 100644 --- a/react-redux/src/App.js +++ b/react-redux/src/App.js @@ -1,4 +1,5 @@ import "./App.css"; +import Study from "./Study"; const Head = (props) =>

{props.title}

; @@ -6,7 +7,7 @@ function App() { return ( <> - + ); } diff --git a/react-redux/src/Study.js b/react-redux/src/Study.js new file mode 100644 index 00000000..67b26d26 --- /dev/null +++ b/react-redux/src/Study.js @@ -0,0 +1,30 @@ +import React, { Component } from "react"; + +const Loading = () =>
Loading...
; + +class Study extends Component { + constructor(props) { + super(props); + this.state = { + loading: true, + }; + } + + comment() { + const { loading } = this.state; + const con = 1; + const res = con > 0 ? true : false; // 두가지 조건 (if, else) + const and = loading &&
loading...
; // 한가지 조건(if) + } + render() { + const { loading } = this.state; + return ( + <> + {loading ? :
this is a webpage
} + {loading && } + + ); + } +} + +export default Study;