Browse Source

fix(docs): fix hook deps (#36569)

Jonas 2 years ago
parent
commit
0693a1ebdc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      docs-ui/components/code.tsx

+ 2 - 2
docs-ui/components/code.tsx

@@ -1,7 +1,7 @@
 // eslint-disable-next-line simple-import-sort/imports
 import 'prismjs/themes/prism.css';
 
-import {createRef, RefObject, useEffect, useRef, useState} from 'react';
+import {useEffect, useRef, useState} from 'react';
 import {useTheme} from '@emotion/react';
 import styled from '@emotion/styled';
 import copy from 'copy-text-to-clipboard';
@@ -42,7 +42,7 @@ type Props = {
 
 const Code = ({children, className, label}: Props) => {
   const theme = useTheme();
-  const codeRef: RefObject<HTMLElement> = createRef();
+  const codeRef = useRef<HTMLElement | null>(null);
   const copyTimeoutRef = useRef<number | undefined>(undefined);
 
   const [copied, setCopied] = useState(false);