Skip to content

Commit

Permalink
feat(Spinner): make the animation default to border (#6468)
Browse files Browse the repository at this point in the history
* make the spinner animation default to border

There's no good reason to always type out the animation for the spinner. There are only two choices, and the "border" option is the obvious choice as a default.

This should be a non-breaking change.

* use default prop for spinner animation parameter
  • Loading branch information
factoidforrest committed Nov 3, 2022
1 parent c4b15a3 commit fb3e4d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Spinner.tsx
Expand Up @@ -9,7 +9,7 @@ import { Variant } from './types';
export interface SpinnerProps
extends React.HTMLAttributes<HTMLElement>,
BsPrefixProps {
animation: 'border' | 'grow';
animation?: 'border' | 'grow';
size?: 'sm';
variant?: Variant;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ const Spinner: BsPrefixRefForwardingComponent<'div', SpinnerProps> =
{
bsPrefix,
variant,
animation,
animation = 'border',
size,
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
as: Component = 'div',
Expand All @@ -75,7 +75,6 @@ const Spinner: BsPrefixRefForwardingComponent<'div', SpinnerProps> =
) => {
bsPrefix = useBootstrapPrefix(bsPrefix, 'spinner');
const bsSpinnerPrefix = `${bsPrefix}-${animation}`;

return (
<Component
ref={ref}
Expand Down

0 comments on commit fb3e4d5

Please sign in to comment.