JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.49k stars 4.12k forks source link

Cannot import types after update #5770

Closed xec closed 10 months ago

xec commented 10 months ago

After updating to latest (5.7.7) I get an error when attempting a type (the Select class):

import type SelectClass from 'react-select/dist/declarations/src/Select'
Cannot find module 'react-select/dist/declarations/src/Select' or its corresponding type declarations.ts(2307)

The culprit seems to be the exports section in package.json which only allows very specific imports.

This was introduced in https://github.com/JedWatson/react-select/pull/5559

I've suggested a fix in https://github.com/JedWatson/react-select/pull/5769 by adding an export rule for type definitions, but I'm open to other solutions/suggestions if any :)

xec commented 10 months ago

Closing since I found a duplicate of this, sorry about the noise!

https://github.com/JedWatson/react-select/issues/5743