Skip to content

Commit f12e5b3

Browse files
authored
Merge pull request #292 from csandman/fix/module-augmentation
2 parents 3d9c4fc + 3e74e23 commit f12e5b3

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"sideEffects": false,
4646
"types": "dist/types/index.d.ts",
4747
"dependencies": {
48-
"react-select": "5.7.0"
48+
"react-select": "5.7.7"
4949
},
5050
"peerDependencies": {
5151
"@chakra-ui/form-control": "^2.0.0",

src/module-augmentation.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@ import type {
99
Variant,
1010
} from "./types";
1111

12+
/**
13+
* This is necessary for the module `react-select/base` to be seen by TypeScript.
14+
* Without it the module augmentation will not work properly.
15+
*
16+
* @see {@link https://github.com/JedWatson/react-select/pull/5762#issuecomment-1765467219}
17+
*/
18+
export type {} from "react-select/base";
19+
1220
/**
1321
* Module augmentation is used to add extra props to the existing interfaces
1422
* from `react-select` as per the docs
1523
*
1624
* @see {@link https://react-select.com/typescript#custom-select-props}
1725
*/
18-
declare module "react-select/dist/declarations/src/Select" {
26+
declare module "react-select/base" {
1927
export interface Props<
2028
Option,
2129
IsMulti extends boolean,
@@ -197,7 +205,7 @@ declare module "react-select/dist/declarations/src/Select" {
197205
}
198206
}
199207

200-
declare module "react-select/dist/declarations/src/components/MultiValue" {
208+
declare module "react-select" {
201209
export interface MultiValueProps<
202210
Option,
203211
IsMulti extends boolean,
@@ -222,9 +230,7 @@ declare module "react-select/dist/declarations/src/components/MultiValue" {
222230
isFocused: boolean;
223231
sx: SystemStyleObject;
224232
}
225-
}
226233

227-
declare module "react-select/dist/declarations/src/components/indicators" {
228234
export interface LoadingIndicatorProps<
229235
Option,
230236
IsMulti extends boolean,

0 commit comments

Comments
 (0)