File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ const Spinner = props => {
2222 fullscreenClassName,
2323 fullscreen_style,
2424 debounce,
25+ show_initially,
2526 ...otherProps
2627 } = props ;
2728
28- const [ showSpinner , setShowSpinner ] = useState ( false ) ;
29+ const [ showSpinner , setShowSpinner ] = useState ( show_initially ) ;
2930 const timer = useRef ( ) ;
3031
3132 useEffect ( ( ) => {
@@ -121,7 +122,8 @@ const Spinner = props => {
121122Spinner . _dashprivate_isLoadingComponent = true ;
122123
123124Spinner . defaultProps = {
124- debounce : 0
125+ debounce : 0 ,
126+ show_initially : true
125127} ;
126128
127129Spinner . propTypes = {
@@ -187,7 +189,13 @@ Spinner.propTypes = {
187189 * When using the spinner as a loading spinner, add a time delay (in ms) to
188190 * the spinner being removed to prevent flickering.
189191 */
190- debounce : PropTypes . number
192+ debounce : PropTypes . number ,
193+
194+ /**
195+ * Whether the Spinner should show on app start-up before the loading state
196+ * has been determined. Default True.
197+ */
198+ show_initially : PropTypes . bool
191199} ;
192200
193201export default Spinner ;
You can’t perform that action at this time.
0 commit comments