mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
upgrade packages + improve typing
This commit is contained in:
parent
fd55f4fb7f
commit
19f5eefdd2
138 changed files with 4504 additions and 11015 deletions
|
|
@ -1,9 +1,7 @@
|
|||
import {
|
||||
render,
|
||||
fireEvent,
|
||||
getByRole,
|
||||
waitFor,
|
||||
act
|
||||
} from '@testing-library/react';
|
||||
import { useFireOnce } from './useFireOnce';
|
||||
|
||||
|
|
@ -21,7 +19,7 @@ describe('useFireOnce hook', () => {
|
|||
|
||||
function Button(props) {
|
||||
const { children, onClick } = props
|
||||
const [buttonIsDisabled, setButtonIsDisabled, handleClickOnce] = useFireOnce(onClick)
|
||||
const [buttonIsDisabled, _setButtonIsDisabled, handleClickOnce] = useFireOnce(onClick)
|
||||
return <button onClick={handleClickOnce} disabled={buttonIsDisabled}>{children}</button>
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +63,7 @@ describe('useFireOnce hook', () => {
|
|||
|
||||
function Form(props) {
|
||||
const { onSubmit } = props
|
||||
const [buttonIsDisabled, setButtonIsDisabled, handleSubmitOnce] = useFireOnce(onSubmit)
|
||||
const [buttonIsDisabled, _setButtonIsDisabled, handleSubmitOnce] = useFireOnce(onSubmit)
|
||||
return (
|
||||
<form onSubmit={handleSubmitOnce}>
|
||||
<input type="text" defaultValue="Hell World" name="thing-to-say" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue