fix: remove redundant effect dependency

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-02 19:45:11 +02:00
parent eb850a600c
commit 3b2054532c

View file

@ -8,7 +8,6 @@ import { ShowIf } from '../../../components/common/show-if/show-if'
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer' import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
import { cypressId } from '../../../utils/cypress-attribute' import { cypressId } from '../../../utils/cypress-attribute'
import { Logger } from '../../../utils/logger' import { Logger } from '../../../utils/logger'
import { useRouter } from 'next/router'
import React, { useCallback, useEffect, useRef, useState } from 'react' import React, { useCallback, useEffect, useRef, useState } from 'react'
import { Alert } from 'react-bootstrap' import { Alert } from 'react-bootstrap'
import { useAsync } from 'react-use' import { useAsync } from 'react-use'
@ -24,8 +23,6 @@ export const GraphvizFrame: React.FC<CodeProps> = ({ code }) => {
const container = useRef<HTMLDivElement>(null) const container = useRef<HTMLDivElement>(null)
const [error, setError] = useState<string>() const [error, setError] = useState<string>()
const { basePath } = useRouter()
const { const {
value: graphvizImport, value: graphvizImport,
error: libLoadingError, error: libLoadingError,
@ -58,7 +55,7 @@ export const GraphvizFrame: React.FC<CodeProps> = ({ code }) => {
} catch (error) { } catch (error) {
showError(error as string) showError(error as string)
} }
}, [code, basePath, showError, graphvizImport]) }, [code, showError, graphvizImport])
return ( return (
<AsyncLoadingBoundary loading={isLibLoading || !graphvizImport} componentName={'graphviz'} error={libLoadingError}> <AsyncLoadingBoundary loading={isLibLoading || !graphvizImport} componentName={'graphviz'} error={libLoadingError}>