@@ -40,7 +40,7 @@ const useOriginId = getUseId();
4040
4141export default useOriginId
4242 ? // Use React `useId`
43- function useId ( id ?: string , forceUseId ?: boolean ) {
43+ function useId ( id ?: string , disableTestMock ?: boolean ) {
4444 const reactId = useOriginId ( ) ;
4545
4646 // Developer passed id is single source of truth
@@ -49,14 +49,14 @@ export default useOriginId
4949 }
5050
5151 // By default, test env always return mock id, but also allow force use id for test case which need to test id logic.
52- if ( ! forceUseId && process . env . NODE_ENV === 'test' ) {
52+ if ( ! disableTestMock && process . env . NODE_ENV === 'test' ) {
5353 return 'test-id' ;
5454 }
5555
5656 return reactId ;
5757 }
5858 : // Use compatible of `useId`
59- function useCompatId ( id ?: string , forceUseId ?: boolean ) {
59+ function useCompatId ( id ?: string , disableTestMock ?: boolean ) {
6060 // Inner id for accessibility usage. Only work in client side
6161 const [ innerId , setInnerId ] = React . useState < string > ( 'ssr-id' ) ;
6262
@@ -73,7 +73,7 @@ export default useOriginId
7373 }
7474
7575 // By default, test env always return mock id, but also allow force use id for test case which need to test id logic.
76- if ( ! forceUseId && process . env . NODE_ENV === 'test' ) {
76+ if ( ! disableTestMock && process . env . NODE_ENV === 'test' ) {
7777 return 'test-id' ;
7878 }
7979
0 commit comments