Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dfx new templates in the react quickstart example #3963

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

#### 3. Setup the project using `npm`.
This example project uses a [Motoko](/docs/current/motoko/main/getting-started/motoko-introduction), React, and TypeScript template to create a simple Hello application.

```
npm run setup
```

#### 4. Deploy the project.
#### 3. Deploy the project.

```
cd react-project
dfx deploy --playground
```

Expand All @@ -130,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.

:::
Loading