Skip to content

Commit 406eee3

Browse files
authored
Rename delay props in Spinner (#705)
1 parent 1e4a5cb commit 406eee3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/content/migration-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ the [Bootstrap grid docs](https://getbootstrap.com/docs/5.0/layout/grid/#row-col
161161
- <span class="badge bg-danger">Breaking</span> Dropped `bs_size` property. Use `size` instead.
162162

163163
### Spinner
164-
- `Spinner` has a new prop `show_delay` which can be used to control how long a component should be loading for before the spinner shows.
165-
- <span class="badge bg-danger">Breaking</span> `debounce` prop has been renamed to `hide_delay` to mirror `show_delay`. This prop adds a delay to the spinner being hidden once the child component has finished loading.
164+
- `Spinner` has a new prop `delay_show` which can be used to control how long a component should be loading for before the spinner shows.
165+
- <span class="badge bg-danger">Breaking</span> `debounce` prop has been renamed to `delay_hide` to mirror `delay_show`. This prop adds a delay to the spinner being hidden once the child component has finished loading.
166166

167167
### Switch <span class="badge bg-success">New</span>
168168
- New `Switch` component. See the documentation [here](/docs/components/input)

src/components/spinner/Spinner.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const Spinner = props => {
2323
fullscreenClassName,
2424
fullscreen_class_name,
2525
fullscreen_style,
26-
hide_delay,
27-
show_delay,
26+
delay_hide,
27+
delay_show,
2828
show_initially,
2929
type,
3030
...otherProps
@@ -48,7 +48,7 @@ const Spinner = props => {
4848
showTimer.current = setTimeout(() => {
4949
setShowSpinner(true);
5050
showTimer.current = null;
51-
}, show_delay);
51+
}, delay_show);
5252
}
5353
} else {
5454
// if component is not currently loading and there's a show timer
@@ -62,11 +62,11 @@ const Spinner = props => {
6262
dismissTimer.current = setTimeout(() => {
6363
setShowSpinner(false);
6464
dismissTimer.current = null;
65-
}, hide_delay);
65+
}, delay_hide);
6666
}
6767
}
6868
}
69-
}, [hide_delay, show_delay, loading_state]);
69+
}, [delay_hide, delay_show, loading_state]);
7070

7171
const isBootstrapColor = bootstrapColors.has(color);
7272

@@ -154,8 +154,8 @@ const Spinner = props => {
154154
Spinner._dashprivate_isLoadingComponent = true;
155155

156156
Spinner.defaultProps = {
157-
hide_delay: 0,
158-
show_delay: 0,
157+
delay_hide: 0,
158+
delay_show: 0,
159159
show_initially: true,
160160
type: 'border'
161161
};
@@ -237,13 +237,13 @@ Spinner.propTypes = {
237237
* When using the spinner as a loading spinner, add a time delay (in ms) to
238238
* the spinner being removed to prevent flickering.
239239
*/
240-
hide_delay: PropTypes.number,
240+
delay_hide: PropTypes.number,
241241

242242
/**
243243
* When using the spinner as a loading spinner, add a time delay (in ms) to
244244
* the spinner being shown after the loading_state is set to true.
245245
*/
246-
show_delay: PropTypes.number,
246+
delay_show: PropTypes.number,
247247

248248
/**
249249
* Whether the Spinner should show on app start-up before the loading state

0 commit comments

Comments
 (0)