Skip to content

Update init.md #2700

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

Open
wants to merge 2 commits into
base: main
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
14 changes: 7 additions & 7 deletions docs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
There are couple of ways to initialize new React Native projects.

```sh
npx react-native@latest init ProjectName
npx react-native-community/cli@latest init ProjectName
```

> Note: If you have both `yarn` and `npm` installed on your machine, React Native CLI will always try to use `npm`. You can force usage of `yarn` by adding `--pm yarn` flag to the command.
Expand All @@ -20,10 +20,10 @@ yarn init && yarn add react-native && yarn react-native init ProjectName

```sh
# This will use the latest init command but will install react-native@VERSION and use its template
npx react-native@latest init ProjectName --version ${VERSION}
npx react-native-community/cli@latest init ProjectName --version ${VERSION}

# This will use init command from react-native@VERSION
npx react-native@${VERSION} init ProjectName
# This will use init command from react-native@VERSION through react-native-community/cli@${VERSION} (e.g. X.XX.X) automatically
npx react-native-community/cli@${VERSION} init ProjectName
```

## Initializing project with custom template
Expand All @@ -43,16 +43,16 @@ For all available options, please check [Yarn documentation](https://classic.yar

```sh
# This will initialize new project using template from `react-native-template-typescript` package
npx react-native@latest init ProjectName --template ${TEMPLATE_NAME}
npx react-native-community/cli@latest init ProjectName --template ${TEMPLATE_NAME}

# This will initialize new project using init command from react-native@VERSION but will use a custom template
npx react-native@${VERSION} init ProjectName --template ${TEMPLATE_NAME}
npx react-native-community/cli@${VERSION} init ProjectName --template ${TEMPLATE_NAME}
```

You can force usage of `yarn` if you have both `yarn` and `npm` installed on your machine:

```sh
npx react-native@latest init ProjectName --pm yarn
npx react-native-community/cli@latest init ProjectName --pm yarn
```

## Creating custom template
Expand Down