File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const useOriginId = getUseId();
4040
4141export default useOriginId
4242 ? // Use React `useId`
43- function useId ( id ?: string , forceReactUseId ?: boolean ) {
43+ function useId ( id ?: string , forceUseId ?: 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 // Test env always return mock id
52- if ( ! forceReactUseId && process . env . NODE_ENV === 'test' ) {
52+ if ( ! forceUseId && 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 ) {
59+ function useCompatId ( id ?: string , forceUseId ?: 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 // Test env always return mock id
76- if ( process . env . NODE_ENV === 'test' ) {
76+ if ( ! forceUseId && process . env . NODE_ENV === 'test' ) {
7777 return 'test-id' ;
7878 }
7979
You can’t perform that action at this time.
0 commit comments