seungjun
seungjun

Reputation: 101

cannot initiate expo bare workflow with typescript

I`m trying to initiate expo bare workflow with typescirpt.

But after I type "expo init [project name]" in command window,

I cannot find minimal(typescirpt) option.

? Choose a template: » - Use arrow-keys. Return to submit.
    ----- Managed workflow -----
    blank               a minimal app as clean as an empty canvas
    blank (TypeScript)  same as blank but with TypeScript configuration
    tabs (TypeScript)   several example screens and tabs using react-navigation and TypeScript
    ----- Bare workflow -----
>   minimal             bare and minimal, just the essentials to get you started

Dose anyone know solution?

Upvotes: 10

Views: 8382

Answers (3)

Vladimir Vovk
Vladimir Vovk

Reputation: 798

*** Update November 2024 ***

Option 1

Initialize the project with npx create-expo-app@latest or npx create-expo-app@latest --template blank-typescript

Option 2

Use the template with one command npx create-expo-app -t expo-ts.

For more info please read the Starting React Native Project in 2025 article.

*** Update January 2024 ***

Option 1

  1. Initialize the project with npx create-expo-app command.
  2. Create a tsconfig.json in your project root with touch tsconfig.json.
  3. Rename App.js to App.tsx with mv App.js App.tsx.
  4. Run yarn start or npm run start. It will prompt you to install the required dependencies (typescript, @types/react, @types/react-native), and automatically configure your tsconfig.json.
  5. Switch to the "bare" workflow with npx expo eject command.

For more info see the docs on Expo Typescript support.

Option 2

Initialize the project with npx react-native init MyApp --template react-native-template-typescript command.

For more info see the docs on React Native Typescript support.

Option 3

Use the template with one command npx create-expo-app -t expo-ts.

For more info please read Starting React Native Project in 2024 article.

*** Original Answer February 2022 ***

Option 1

  1. Initialize the project with expo init command and choose minimal as a template. Or use this command: expo init --template bare-minimum --name <your-app-name>.
  2. Create a tsconfig.json in your project root: touch tsconfig.json.
  3. Rename App.js to App.tsx: mv App.js App.tsx.
  4. Run expo start. It will prompt you to install the required dependencies (typescript, @types/react, @types/react-native), and automatically configure your tsconfig.json.

For more info see the docs on Expo Typescript support.

Option 2

Use the template with one command expo init --template @vladimir-vovk/expo-bare-typescript.

For more info please read Starting React Native Project in 2022 article.

!! Unfortunately, expo-template-bare-typescript package is outdated. It will install Expo 41.

Upvotes: 22

Erick Amoedo
Erick Amoedo

Reputation: 485

+ 4.62.0: there is no longer the option to create a Bare Workflow project with Typescript already configured.

So:

  1. run: expo init nome-do-seu-app
  2. Choose: Bare Workflow -> Minimal
  3. Create a tsconfig.json in your project root
  4. Run expo start. It will prompt you to install the required dependencies (typescript, @types/react, @types/react-native), and automatically configure your tsconfig.json.

enter image description here

  1. Open the tsconfig.json and add "strict": true

enter image description here

  1. Rename App.js to App.tsx: mv App.js App.tsx.

Finish 🥳

Now your project Bare Workflow is with Typescript configured!

Upvotes: 5

Felipe Kafuri
Felipe Kafuri

Reputation: 29

Im with this issue to, but you can initiate your project by running

 expo init --template expo-template-bare-typescript --name appname

Upvotes: 2

Related Questions