playcanvas / pcui

UI component library for web-based tools
http://playcanvas.github.io/pcui
MIT License
664 stars 62 forks source link

Remove: flag allowSyntheticDefaultImports from ts config #282

Closed forij closed 1 year ago

forij commented 1 year ago

Problem: by default TS dosen't allow "synthetic default imports"

https://user-images.githubusercontent.com/17799857/213328964-e21c475a-671f-4cc0-9c95-663b6205b23c.mp4

Local solution:

Add the line allowsynthgeticsdefaultports: true to the tsconfig.json

Global solution

Change import React from 'react'; => import * as React from 'react'; in pcui repo. This change will allow use pcui without set "allowSyntheticDefaultImports: true" flag in tsconfig.json.

( if you not appruve that pr please add some message about this flag in documentation, for people who want to use pcui with typescript )