@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33import { omit } from 'ramda' ;
44import RBAccordion from 'react-bootstrap/Accordion' ;
55
6- import { stringifyId } from '../../private/util' ;
6+ import { getLoadingState , stringifyId } from '../../private/util' ;
77import { AccordionContext } from '../../private/AccordionContext' ;
88
99/**
@@ -12,7 +12,6 @@ import {AccordionContext} from '../../private/AccordionContext';
1212const AccordionItem = ( {
1313 title,
1414 item_id,
15- loading_state,
1615 class_name,
1716 className,
1817 id,
@@ -31,9 +30,7 @@ const AccordionItem = ({
3130 [ 'setProps' , 'persistence' , 'persistence_type' , 'persisted_props' ] ,
3231 otherProps
3332 ) }
34- data-dash-is-loading = {
35- ( loading_state && loading_state . is_loading ) || undefined
36- }
33+ data-dash-is-loading = { getLoadingState ( ) || undefined }
3734 >
3835 < RBAccordion . Header onClick = { ( ) => toggle ( itemID ) } >
3936 { title }
@@ -84,25 +81,7 @@ AccordionItem.propTypes = {
8481 * will be set to "item-i" where i is (zero indexed) position of item in list
8582 * items pased to Accordion component.
8683 */
87- item_id : PropTypes . string ,
88-
89- /**
90- * Object that holds the loading state object coming from dash-renderer
91- */
92- loading_state : PropTypes . shape ( {
93- /**
94- * Determines if the component is loading or not
95- */
96- is_loading : PropTypes . bool ,
97- /**
98- * Holds which property is loading
99- */
100- prop_name : PropTypes . string ,
101- /**
102- * Holds the name of the component that is loading
103- */
104- component_name : PropTypes . string
105- } )
84+ item_id : PropTypes . string
10685} ;
10786
10887export default AccordionItem ;
0 commit comments