๋ฐ˜์‘ํ˜•

๐ŸŸฉ Frontend-HTML & CSS & +JS/๐Ÿ”ฐ React 12

React ์ปดํฌ๋„ŒํŠธ ์•ˆ์— ์ž์‹์š”์†Œ ์ปดํฌ๋„ŒํŠธ ๋„ฃ๊ธฐ (wrapper ์•ˆ์— ๋‹ค๋ฅธ div๋„ฃ๊ธฐ)

App.js์—์„œ Wrapper ๋ผ๋Š” ์ปดํฌ๋„ŒํŠธ๋ฅผ ์“ฐ๋‹ค๊ฐ€,Wrapper์•ˆ์— ์ƒˆ๋กœ์šด ์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•˜๋Š” ์ƒํ™ฉ์ด๋ผ๋ฉด,(์›๋ž˜ ์ปดํฌ๋„ŒํŠธ ์•ˆ์— ํƒœ๊ทธ๋ฅผ ์ถ”๊ฐ€ ํ•  ์ˆ˜์—†์Œใ…‡) ๊ธฐ์กด Wrapper.jsx์•ˆ์— ์ฝ”๋“œ(div,p ๋“ฑ๋“ฑ) ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•˜์ง€๋งŒ,Wrapper.jsx์— children ์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•จ์œผ๋กœ์จhtml ์ฒ˜๋Ÿผ App.js์— ์ž์‹์š”์†Œ๋ฅผ ๊ทธ๋Œ€๋กœ ๋„ฃ์„ ์ˆ˜ ์žˆ๊ฒŒ ๋จ   | Wrapper.jsx ์ฝ”๋“œimport React from "react";function Wrapper({ children }) { return( {children} );}export default Wrapper; Wrapper ์— ์ž์‹์š”์†Œ๋กœ ๋“ค์–ด๊ฐˆ children ์„ ์ง€์ •ํ•ด์ฃผ๊ณ ,App.js์—์„œ html ์—์„œ div,p๋“ฑ๋“ฑ์„ ์ž…๋ ฅํ•˜๋“ฏ ์ž‘์„ฑํ•จ  ..

React (const๋กœ ์Šคํƒ€์ผ ์ง€์ •) ๊ฐ์ฒดํ˜•์œผ๋กœ ํ˜„์žฌ ์ปดํฌ๋„ŒํŠธ ์•ˆ ์Šคํƒ€์ผ์ ์šฉ

App.jsimport React from "react";import Wrapper from "./component/Wrapper";import Hello from "./component/Hello";import "./App.css";function App() { /* ๊ฐ์ฒดํ˜•์œผ๋กœ ํ˜„์žฌ ์ปดํฌ๋„ŒํŠธ์—์„œ ์Šคํƒ€์ผ์„ ์„ ์–ธํ•˜๋Š” ๋ฐฉ๋ฒ• */ const style = { backgroundColor: "skyblue", color: "white", fontSize: 40, padding: "1rem", }; const name = "hello2"; return ( {/* css๋ฅผ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• : className ์†์„ฑ์— ์ ์šฉ */} {/* ์ปดํฌ๋„ŒํŠธ์•ˆ์— ..

๋ฐ˜์‘ํ˜•