File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
packages/docsearch-react/src Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1- import React , { useEffect , useState } from 'react' ;
1+ import React , { useState } from 'react' ;
22
33import { ControlKeyIcon } from './icons/ControlKeyIcon' ;
44import { SearchIcon } from './icons/SearchIcon' ;
@@ -25,15 +25,14 @@ export const DocSearchButton = React.forwardRef<
2525> ( ( { translations = { } , ...props } , ref ) => {
2626 const { buttonText = 'Search' , buttonAriaLabel = 'Search' } = translations ;
2727
28- const [ key , setKey ] = useState <
28+ const [ key ] = useState <
2929 typeof ACTION_KEY_APPLE | typeof ACTION_KEY_DEFAULT | null
30- > ( null ) ;
31-
32- useEffect ( ( ) => {
30+ > ( ( ) => {
3331 if ( typeof navigator !== 'undefined' ) {
34- setKey ( isAppleDevice ( ) ? ACTION_KEY_APPLE : ACTION_KEY_DEFAULT ) ;
32+ return isAppleDevice ( ) ? ACTION_KEY_APPLE : ACTION_KEY_DEFAULT ;
3533 }
36- } , [ ] ) ;
34+ return null ;
35+ } ) ;
3736
3837 return (
3938 < button
You can’t perform that action at this time.
0 commit comments