Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #6119
Closed
Open
Issue created Jan 03, 2019 by Administrator@rootContributor

Friction in TypeScript setup experience

Created by: DanielRosenwasser

In trying to update the TypeScript React Starter, I'm trying to leverage the newly supported support in CRA; however, running create-react-app with the --typescript flag seems to not do anything, and the process of adding TypeScript in general has a bit of friction.

As an example, I ran

npx create-react-app myapp --typescript

I expected at least the following:

  1. My files should have been .ts/.tsx files.
  2. A prescriptive tsconfig.json file should have been given to me out of the box.
  3. My devDependencies should have included typescript, @types/react, and @types/react-dom.

Instead,

  1. The --typescript flag didn't do anything special, and I had to rename a file like App.js to App.tsx before yarn start gave me a tsconfig.json.
  2. yarn start told to run yarn add typescript after the rename (which is misleading since it should be a devDependency - so yarn add -D typescript).
  3. Running yarn start one more time, I was given a type-error because I was missing @types/react and @types/react-dom as devDependencies.

Then everything worked, but this feels extremely frictiony. And it's also fairly confusing, because this flag doesn't seem to give anything beyond what the standard CRA scaffolding gives. And other issues have pointed this out too:

  • #5939 (closed)
  • https://github.com/facebook/create-react-app/issues/5895#issuecomment-441543433
Assignee
Assign to
Time tracking