Skip to content

Commit 137c185

Browse files
Merge branch 'master' into update-sortable
2 parents 5fa3f97 + 011a9d9 commit 137c185

File tree

4 files changed

+47
-33
lines changed

4 files changed

+47
-33
lines changed

packages/react-select/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# react-select
22

3+
## 5.7.4
4+
5+
### Patch Changes
6+
7+
- [`16414bb5`](https://github.com/JedWatson/react-select/commit/16414bb53295b362690d2b089d74182ddeabc1dd) [#5689](https://github.com/JedWatson/react-select/pull/5689) Thanks [@Rall3n](https://github.com/Rall3n)! - Resolve `defaultProps` deprecation warning for React v18+.
8+
39
## 5.7.3
410

511
### Patch Changes

packages/react-select/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-select",
3-
"version": "5.7.3",
3+
"version": "5.7.4",
44
"description": "A Select control built with and for ReactJS",
55
"main": "dist/react-select.cjs.js",
66
"module": "dist/react-select.esm.js",

packages/react-select/src/components/Menu.tsx

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -498,49 +498,53 @@ export const NoOptionsMessage = <
498498
Option,
499499
IsMulti extends boolean,
500500
Group extends GroupBase<Option>
501-
>(
502-
props: NoticeProps<Option, IsMulti, Group>
503-
) => {
504-
const { children, innerProps } = props;
501+
>({
502+
children = 'No options',
503+
innerProps,
504+
...restProps
505+
}: NoticeProps<Option, IsMulti, Group>) => {
505506
return (
506507
<div
507-
{...getStyleProps(props, 'noOptionsMessage', {
508-
'menu-notice': true,
509-
'menu-notice--no-options': true,
510-
})}
508+
{...getStyleProps(
509+
{ ...restProps, children, innerProps },
510+
'noOptionsMessage',
511+
{
512+
'menu-notice': true,
513+
'menu-notice--no-options': true,
514+
}
515+
)}
511516
{...innerProps}
512517
>
513518
{children}
514519
</div>
515520
);
516521
};
517-
NoOptionsMessage.defaultProps = {
518-
children: 'No options',
519-
};
520522

521523
export const LoadingMessage = <
522524
Option,
523525
IsMulti extends boolean,
524526
Group extends GroupBase<Option>
525-
>(
526-
props: NoticeProps<Option, IsMulti, Group>
527-
) => {
528-
const { children, innerProps } = props;
527+
>({
528+
children = 'Loading...',
529+
innerProps,
530+
...restProps
531+
}: NoticeProps<Option, IsMulti, Group>) => {
529532
return (
530533
<div
531-
{...getStyleProps(props, 'loadingMessage', {
532-
'menu-notice': true,
533-
'menu-notice--loading': true,
534-
})}
534+
{...getStyleProps(
535+
{ ...restProps, children, innerProps },
536+
'loadingMessage',
537+
{
538+
'menu-notice': true,
539+
'menu-notice--loading': true,
540+
}
541+
)}
535542
{...innerProps}
536543
>
537544
{children}
538545
</div>
539546
);
540547
};
541-
LoadingMessage.defaultProps = {
542-
children: 'Loading...',
543-
};
544548

545549
// ==============================
546550
// Menu Portal

packages/react-select/src/components/indicators.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,22 @@ export const LoadingIndicator = <
287287
Option,
288288
IsMulti extends boolean,
289289
Group extends GroupBase<Option>
290-
>(
291-
props: LoadingIndicatorProps<Option, IsMulti, Group>
292-
) => {
293-
const { innerProps, isRtl } = props;
294-
290+
>({
291+
innerProps,
292+
isRtl,
293+
size = 4,
294+
...restProps
295+
}: LoadingIndicatorProps<Option, IsMulti, Group>) => {
295296
return (
296297
<div
297-
{...getStyleProps(props, 'loadingIndicator', {
298-
indicator: true,
299-
'loading-indicator': true,
300-
})}
298+
{...getStyleProps(
299+
{ ...restProps, innerProps, isRtl, size },
300+
'loadingIndicator',
301+
{
302+
indicator: true,
303+
'loading-indicator': true,
304+
}
305+
)}
301306
{...innerProps}
302307
>
303308
<LoadingDot delay={0} offset={isRtl} />
@@ -306,4 +311,3 @@ export const LoadingIndicator = <
306311
</div>
307312
);
308313
};
309-
LoadingIndicator.defaultProps = { size: 4 };

0 commit comments

Comments
 (0)