Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix react-select core Props type export #324

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Conversation

csandman
Copy link
Owner

@csandman csandman commented Jul 4, 2024

After my previous change to switch to tsup for building the project, I had to do a lot of shifting types around to ensure the module augmentation to add the custom props was still working properly. However, I realized that after doing so I ended up exporting the core Props type from react-select/base instead of just react-select. These do not have an identical type definition as the props that are normally exported, and thus can't be used to define props external to a select component in the same way.

To fix this, I stopped exporting the props, and switched my main import for these base props:

import type { Props } from "react-select/base";

to an export:

export type { Props as ReactSelectBaseProps } from "react-select/base";

based on this comment: JedWatson/react-select#5762 (comment)

I still don't fully understand what the end result of all of this is, but I do know that it now works!

Copy link

codesandbox-ci bot commented Jul 4, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

github-actions bot commented Jul 4, 2024

📊 Package size report   0.3%↑

File Before After
dist/index.cjs.map 81.1 kB 0.3%↑81.3 kB
dist/index.d.cts 21.0 kB 0.9%↑21.1 kB
dist/index.d.ts 21.0 kB 0.9%↑21.1 kB
dist/index.js.map 81.4 kB 0.3%↑81.7 kB
Total (Includes all files) 288.3 kB 0.3%↑289.2 kB
Tarball size 66.9 kB 0.2%↑67.0 kB
Unchanged files
File Size
dist/index.cjs 17.2 kB
dist/index.js 16.0 kB
LICENSE.md 1.1 kB
package.json 3.3 kB
README.md 46.3 kB

🤖 This report was automatically generated by pkg-size-action

@csandman csandman merged commit a1f9444 into main Jul 4, 2024
5 checks passed
@csandman csandman deleted the fix/correct-type-export branch July 4, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant