react-component / util

Common Utils For React Component
util.vercel.app
MIT License
622 stars 176 forks source link

Fix ESM exports #491

Open jer-sen opened 7 months ago

jer-sen commented 7 months ago

There are many errors to fix in all react-component modules for them to work well when imported from an ESM module.

Importing things from "rc-???" & types from "rc-???/es/..." from an ESM module with recommended (less fault-tolerant / strictest) TS config should not raise any error.

My tsconfig.json contains:

{
  "compilerOptions": {
    "moduleResolution": "NodeNext",
    "module": "NodeNext",
    "skipLibCheck": false,
    "skipDefaultLibCheck": false,
    "allowImportingTsExtensions": false,
    "allowSyntheticDefaultImports": false,
    "strict": true,
    "verbatimModuleSyntax": true,
    "isolatedModules": true
  },
}

Origin of errors:

Interesting reading: