Skip to content

Commit

Permalink
feat: update warning in button component
Browse files Browse the repository at this point in the history
  • Loading branch information
Chisomchima committed Feb 16, 2024
1 parent 07085ff commit 98f7ad8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion components/button/src/button/__tests__/Button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React from 'react'
import { Button } from '../button.js'

describe('<Button>', () => {

let consoleSpy

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion components/button/src/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Button = ({
}, [initialFocus, ref.current])

Check warning on line 38 in components/button/src/button/button.js

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has an unnecessary dependency: 'ref.current'. Either exclude it or remove the dependency array. Mutable values like 'ref.current' aren't valid dependencies because mutating them doesn't re-render the component

const { 'aria-label': ariaLabel, title } = otherProps

if (!children && !title && !ariaLabel) {
console.debug(
'Button component has no children but is missing title or ariaLabel attribute.'
Expand Down

0 comments on commit 98f7ad8

Please sign in to comment.