exportdefaultfunctionBlog(){return(<><Posttitle="An update"body="It's been a while since I posted..."/><Posttitle="My new blog"body="I am starting a new blog!"/></>)}functionPost({title,body}){return(<><PostTitletitle={title}/><PostBodybody={body}/></>);}functionPostTitle({title}){return<h1>{title}</h1>}functionPostBody({body}){return(<article><p>{body}</p></article>);}
import{Fragment}from'react';constposts = [{id:1,title:'An update',body:"It's been a while since I posted..."},{id:2,title:'My new blog',body:'I am starting a new blog!'}];exportdefaultfunctionBlog(){returnposts.map(post=><Fragmentkey={post.id}><PostTitletitle={post.title}/><PostBodybody={post.body}/></Fragment>);}functionPostTitle({title}){return<h1>{title}</h1>}functionPostBody({body}){return(<article><p>{body}</p></article>);}