'inToolbar' is assigned a value but never used
44 const [visibility, setVisibility] = useSetState({ review: true, share: true, save: true })
45
46 /* Contains the actionButtons displayed outside the 'more' actionButton menu */
47 const inToolbar = useMemo( 48 () => (buttonsInViewPort > 3 ? buttons : buttons.slice(-(buttonsInViewPort + 1))),
49 [buttonsInViewPort, buttons]
50 )
'saved' is assigned a value but never used
19 },
20}))
21
22export const Toolbar = ({ saved = false, breadcrumbProps, hideBreadcrumb, ...ids }: Props) => { 23 const theme = useMantineTheme()
24 const isMobile = useMediaQuery(`(max-width: ${theme.breakpoints.sm})`)
25 const { width } = useViewportSize()
Description
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
Bad Practice
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
Recommended
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)