From 01952f00c4a7d1c98821b36e1b7e9c547404f13d Mon Sep 17 00:00:00 2001 From: raymondk Date: Mon, 20 Jan 2025 20:44:14 -0500 Subject: [PATCH 1/2] Use `dfx new` templates in the react quickstart example --- .../quickstart/react-quickstart.mdx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx b/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx index 69ff57bcd1..37de2210ee 100644 --- a/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx +++ b/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx @@ -103,25 +103,19 @@ dfx --version #### 2. Download the React template. -Create a new empty directory, then download the [project template](https://github.com/rvanasa/vite-react-motoko/tree/main/src): +Create a new project: ``` -mkdir react-project -cd react-project -npx degit jessiemongeon1/vite-react-motoko +dfx new react-project --type motoko --frontend react ``` -This example project uses [Motoko](/docs/current/motoko/main/getting-started/motoko-introduction), React, and TypeScript template to create a simple counter application. +This example project uses a [Motoko](/docs/current/motoko/main/getting-started/motoko-introduction), React, and TypeScript template to create a simple Hello application. -#### 3. Setup the project using `npm`. -``` -npm run setup -``` - -#### 4. Deploy the project. +#### 3. Deploy the project. ``` +cd react-project dfx deploy --playground ``` From 9d876e78bd671de2c3b4200b8bb6ad26b7c1567a Mon Sep 17 00:00:00 2001 From: raymondk Date: Mon, 20 Jan 2025 21:01:49 -0500 Subject: [PATCH 2/2] Add info about other templates --- .../getting-started/quickstart/react-quickstart.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx b/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx index 37de2210ee..575a852eda 100644 --- a/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx +++ b/docs/developer-docs/getting-started/quickstart/react-quickstart.mdx @@ -124,3 +124,9 @@ dfx deploy --playground Open the `frontend` URL in a web browser. You'll see the template React frontend interface. *Congratulations, you just created your first internet-native React app!* + +:::info + +You can try other templates, runs `dfx new -h` for more information. + +:::