File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11import * as React from 'react' ;
2+ import { useState } from 'react' ;
23import DisplayName from '../helpers/DisplayName' ;
34import { DivAttributes } from '../helpers/types' ;
45import { assertValidHtmlId , nextUuid } from '../helpers/uuid' ;
@@ -16,12 +17,15 @@ type Props = DivAttributes & {
1617} ;
1718
1819const AccordionItem = ( {
19- uuid = nextUuid ( ) ,
20+ uuid : customUuid ,
2021 dangerouslySetExpanded,
2122 className = 'accordion__item' ,
2223 activeClassName,
2324 ...rest
2425} : Props ) : JSX . Element => {
26+ const [ instanceUuid ] = useState ( nextUuid ( ) ) ;
27+ const uuid = customUuid || instanceUuid ;
28+
2529 const renderChildren = ( itemContext : ItemContext ) : JSX . Element => {
2630 const { expanded } = itemContext ;
2731 const cx = expanded && activeClassName ? activeClassName : className ;
You can’t perform that action at this time.
0 commit comments