diff --git a/beta/src/components/Layout/HomeContent.js b/beta/src/components/Layout/HomeContent.js index 578f00cfc..8387670c8 100644 --- a/beta/src/components/Layout/HomeContent.js +++ b/beta/src/components/Layout/HomeContent.js @@ -5,7 +5,7 @@ import {createContext, useState, useContext} from 'react'; import ButtonLink from '../ButtonLink'; import {Logo} from 'components/Logo'; -import Link from 'next/link'; +import Link from 'components/MDX/Link'; import CodeBlock from 'components/MDX/CodeBlock'; export function HomeContent() { @@ -67,7 +67,7 @@ export function HomeContent() { -
+
@@ -98,6 +98,75 @@ export function HomeContent() {
+
+
+
+
+

+ Go full-stack +
+ with a framework +

+

+ React is a library. It lets you put components together, but + it doesn't prescribe solutions for routing and data fetching. + To get the most out of React, we recommend a React framework + like{' '} + Next.js,{' '} + Remix, and{' '} + Expo. Frameworks let you + create full-stack apps with very little configuration. +

+
+
+ +
+
+

+ React is also an architecture. It bridges the gap + between the client and the server, empowering frameworks + designed for React to use both to the full. Write components, + and let a framework take care of the rest. +

+
+
+
+
+ +
+
+
+
+

+ Use the best +
+ from every platform +

+

+ Web users expect pages to load fast. React can render into an + HTML stream on the server, gradually revealing more content + even before React itself has loaded on the client. React + relies on modern web standards to keep the page responsive + even during rendering. +

+
+
+ +
+
+

+ Mobile app users expect native look-and-feel. With{' '} + React Native, you + can create Android and iOS apps with React. These user + interfaces can feel truly native because they are truly + native. Your React components render real Android and iOS + views natively provided by the platform. +

+
+
+
+
+

@@ -402,7 +471,7 @@ function Example1() {
{` -function PostComment({ author, text, postedAt }) { +function Comment({ author, text, postedAt }) { return ( @@ -475,17 +544,16 @@ function Example2() {
-
{`function Post({ imageUrl, description, comments }) { +
{`function CommentList({ comments }) { let headingText = 'Be the first to comment'; if (comments.length > 0) { headingText = comments.length + ' Comments'; } return ( - {headingText} {comments.map(comment => - + )} @@ -493,6 +561,75 @@ function Example2() { }`}
+
+ + + + + +
+
+ ); +} + +function Example3() { + const [comments, setComments] = useState([ + { + id: 0, + text: 'The quick brown fox jumps over the lazy dog', + postedAt: '4m ago', + author, + }, + { + id: 1, + text: 'The quick brown fox jumps over the lazy dog', + postedAt: '2m ago', + author, + }, + ]); + + function handleAddComment(text) { + setComments((c) => [ + ...c, + { + id: c.length, + text, + postedAt: 'just now', + author, + }, + ]); + } + + return ( +
+
+ +
{`function PostPage({ params }) { + return ( + + }> + + + + ); +} + +async function Post({ id }) { + const post = await db.getPost(params.postId); + return ( + + + + + ); +} +`}
+
+
+ + + + ); +} + +function PostCommentList({comments}) { let headingText = 'Be the first to comment'; if (comments.length > 0) { headingText = comments.length + ' Comments'; } return ( - {headingText} {comments.map((comment) => ( @@ -561,6 +706,7 @@ function CoverImage({src, alt}) { style={{ transform: 'scale(1.2)', transformOrigin: 'bottom', + marginBottom: 16, }} /> ); @@ -597,6 +743,7 @@ function AddComment() {