pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.42k stars 707 forks source link

typesctipt errors `import React from 'react'` related to `esModuleInterop` being enabled. #183

Closed JustFly1984 closed 3 years ago

JustFly1984 commented 3 years ago

Please disable esModuleInterop in tsconfig.json and replace import React from 'react' with import * as React from 'react' in all components.

gsimone commented 3 years ago

Can you document the issue and PR the change?

JustFly1984 commented 3 years ago

created PR https://github.com/pmndrs/drei/pull/184

Issue was reproducing only in projects with esModuleInterop: false. Current fixed imports are working for both states of esModuleInterop in consumer projects, and compatible with react 17. read more: https://epicreact.dev/importing-react-through-the-ages/ Also fixed some rendering issues and improved performance.

joshuaellis commented 3 years ago

Fixed in #198