From 2548dbbb123df4155cb0194e84997b62cc1ddf62 Mon Sep 17 00:00:00 2001 From: toknsiT Date: Fri, 11 Nov 2022 13:23:56 +0800 Subject: [PATCH] page added --- package.json | 3 +++ src/pages/my-component.tsx | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/pages/my-component.tsx diff --git a/package.json b/package.json index 1b7b3ad..8b8ebbd 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,8 @@ "@types/react": "^18.0.25", "@types/react-dom": "^18.0.8", "typescript": "^4.8.4" + }, + "volta": { + "node": "18.12.1" } } diff --git a/src/pages/my-component.tsx b/src/pages/my-component.tsx new file mode 100644 index 0000000..0570991 --- /dev/null +++ b/src/pages/my-component.tsx @@ -0,0 +1,34 @@ +// Step 1: Import React. This lets you use JSX inside your .js file. +import * as React from 'react' + +const ValidComponent = () => { + return ( +
+

A valid component!

+

This will work fine.

+

+ Since there is only one top-level element: the div. +

+
+ ) +} + +const InvalidComponent = () => { + return ( +
+

This won't work.

+

Because there are two elements at the top level.

+
+ ) +} +/* Step 2: Define your component. Note that your +component name should start with a capital letter. */ +const MyComponent = () => { + return ( +

Hi, welcome to my site!

+ ) +} + +/* Step 3: Export your component so it +can be used by other parts of your app. */ +export default MyComponent \ No newline at end of file