File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed
components/dash-html-components/scripts Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -176,24 +176,6 @@ function generatePropTypes(element, attributes) {
176
176
'${ attributeName } ': PropTypes.${ propType } ,` ;
177
177
} , '' ) + `
178
178
179
- /**
180
- * Object that holds the loading state object coming from dash-renderer
181
- */
182
- 'loading_state': PropTypes.shape({
183
- /**
184
- * Determines if the component is loading or not
185
- */
186
- is_loading: PropTypes.bool,
187
- /**
188
- * Holds which property is loading
189
- */
190
- prop_name: PropTypes.string,
191
- /**
192
- * Holds the name of the component that is loading
193
- */
194
- component_name: PropTypes.string,
195
- }),
196
-
197
179
/**
198
180
* Dash-assigned callback that gets fired when the element is clicked.
199
181
*/
@@ -300,7 +282,9 @@ ${customImport}
300
282
*/
301
283
const ${ Component } = ({n_clicks = 0, n_clicks_timestamp = -1, ...props}) => {
302
284
const extraProps = {};
303
- if(props.loading_state && props.loading_state.is_loading) {
285
+ const ctx = window.dash_component_api.useDashContext();
286
+ const loading = ctx.useLoading();
287
+ if (loading) {
304
288
extraProps['data-dash-is-loading'] = true;
305
289
}
306
290
${ customCode }
You can’t perform that action at this time.
0 commit comments