Skip to content

Commit 90cfb8e

Browse files
Remove isLoading prop (#1366)
* Remove isLoading prop * Remove isLoading prop * Update .changeset/public-loops-give.md
1 parent fd89afd commit 90cfb8e

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

.changeset/public-loops-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@obosbbl/grunnmuren-react": major
3+
---
4+
5+
Removes the deprecated `isLoading` prop from `<Button>` and `<Combobox>`, it is now fully replaced by the `isPending` prop.

packages/react/src/button/button.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ const buttonVariants = cva({
119119
type ButtonOrLinkProps = VariantProps<typeof buttonVariants> & {
120120
children?: React.ReactNode;
121121
href?: RACLinkProps['href'];
122-
/**
123-
* Display the button in a loading state
124-
* @deprecated Use isPending instead.
125-
* @default false
126-
*/
127-
isLoading?: boolean;
128122
/** Additional style properties for the element. */
129123
style?: React.CSSProperties;
130124
/** Ref to the element. */
@@ -149,14 +143,11 @@ function Button({ ref = null, ...props }: ButtonProps) {
149143
children: _children,
150144
color,
151145
isIconOnly,
152-
isLoading,
153146
variant,
154-
isPending: _isPending,
147+
isPending,
155148
...restProps
156149
} = props;
157150

158-
const isPending = _isPending || isLoading;
159-
160151
const className = buttonVariants({
161152
className: props.className,
162153
color,

packages/react/src/combobox/combobox.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ type ComboboxProps<T extends object> = {
3030
description?: React.ReactNode;
3131
/** Error message for the form control. Automatically sets `isInvalid` to true */
3232
errorMessage?: React.ReactNode;
33-
/**
34-
* Display the dropdown button trigger in a pending state
35-
* @deprecated Use isPending instead.
36-
*/
37-
isLoading?: boolean;
3833
/**
3934
* Display the dropdown button trigger in a pending state
4035
* @default false
@@ -59,16 +54,13 @@ function Combobox<T extends object>(props: ComboboxProps<T>) {
5954
children,
6055
description,
6156
errorMessage,
62-
isLoading,
63-
isPending: _isPending,
57+
isPending,
6458
label,
6559
isInvalid: _isInvalid,
6660
ref,
6761
...restProps
6862
} = props;
6963

70-
const isPending = _isPending || isLoading;
71-
7264
// the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
7365
// which will override any built in validation
7466
const isInvalid = !!errorMessage || _isInvalid;

0 commit comments

Comments
 (0)