stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.23k stars 888 forks source link

React TypeScript template does not allow fragments #2545

Open IanVS opened 1 year ago

IanVS commented 1 year ago

Description of Bug

I chose to start a new react typescript project, and found that I cannot use <>-style React fragments without setting a TypeScript configuration option.

Steps to Reproduce

  1. Create an empty react typescript project
  2. Try to use a React fragment as <>.

Expected Behavior

There should be no error message, and it should work.

Screenshots/Screencast

image

Additional Context/Questions I can use <React.Fragment> as a workaround, but it's very common to use <></> in React projects instead, and it seems like it should be supported by default.

nusr commented 1 year ago

This problem is fixing now. https://stackblitz.com/edit/stackblitz-starters-v6mpcc?file=src%2FApp.tsx