import * as React from 'react' ; import canUseDom from 'rc-util/lib/Dom/canUseDom' ; let uuid = 0 ; /** Is client side and not jsdom */ export const isBrowserClient = process . env . NODE_ENV !== 'test' && canUseDom ( ) ; /** Get unique id for accessibility usage */ function getUUID ( ) { let retId ; if ( isBrowserClient ) { retId = uuid ; uuid += 1 ; } else { retId = 'TEST_OR_SSR' ; } return retId ; } export default ( id ? ) => { const [ innerId , setInnerId ] = React . useState < string > ( ) ; React . useEffect ( ( ) => { setInnerId ( `rc_progress_${ getUUID ( ) }` ) ; } , [ ] ) ; return id || innerId ; } ;