JSX
1. JSXλ?
2. JSX λ¬Έλ²
<div> <div> <h1>Hello</h1> </div> <div> <h2>World</h2> </div> </div><div className = "greeting">Hello</div>function App () { const name = 'Ella Choi'; return ( <div> Hello, {name}! </div> ); }function Hello() { return <div>Hello!</div> } function HelloWorld() { return <Hello />; }<div> { (1+1 === 2) ? (<p>μ λ΅</p>) : <p>νλ½</p>) } </div>const posts = [ {id: 1, title: 'Hello World', content: 'Welcome to learning React!'}, {id: 2, title: 'Installation', content: 'You can install React from npm'} ]; function Blog() { const content = posts.map((post) => <div key = {post.id}> <h3>{post.title}</h3> <p>{post.content}</p> </div> ); return ( <div> {content} </div> ); }const Hello - () => { return ( [<div>μλ νμΈμ</div>, <div>λ°κ°μ΅λλ€</div>] ) }
Last updated