web-monetization-extension
web-monetization-extension copied to clipboard
Switch component test error
console.error
Warning: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.
at input
at label
at Switch (/Users/radu/dev/web-monetization-extension/packages/extension/src/components/switch.tsx:39:9)
31 |
32 | it('forwards checked prop to input element', () => {
> 33 | render(<Switch checked />)
| ^
34 | const inputElement = screen.getByRole('switch')
35 | expect(inputElement).toBeChecked()
36 | })
@devcer thanks for raising this 👍 I've noticed the test error too and added a default value in the props here