Skip to content

Commit 951aa6d

Browse files
committed
[types] v8 types
1 parent 3f3ea35 commit 951aa6d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

templates/client/src/drawing/BrushSize.tsx.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{addImport "import './brushSize.css';"}}
44

55
export const BrushSize = () => {
6-
const [size, setSize] = useValueState('brushSize', STORE_ID);
6+
const [size, setSize] = useValueState('brushSize', STORE_ID) as [number | undefined, (value: number) => void];
77

88
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
99
setSize(parseInt(e.target.value));
@@ -12,8 +12,8 @@ const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
1212
return (
1313
<div id="brushSize">
1414
<label>Size:</label>
15-
<input type="range" min="1" max="50" value={(size as number) ?? 5} onChange={handleChange} />
16-
<span id="brushSizeValue">{size as number}</span>
15+
<input type="range" min="1" max="50" value={size ?? 5} onChange={handleChange} />
16+
<span id="brushSizeValue">{size}</span>
1717
</div>
1818
);
1919
};

templates/client/src/game/GameStatus.tsx.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
export const GameStatus = () => {
66
const gameStatus = useValue('gameStatus', STORE_ID);
7-
const currentPlayer = useValue('currentPlayer', STORE_ID);
8-
const winner = useValue('winner', STORE_ID);
7+
const currentPlayer = useValue('currentPlayer', STORE_ID) as string;
8+
const winner = useValue('winner', STORE_ID) as string;
99

1010
return (
1111
<div id="gameStatus">

templates/client/src/game/Square.tsx.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{addImport "import {useCell, useSetCellCallback, useValue, STORE_ID} from './Store';"}}
44

55
export const Square = ({position, disabled, winning}: {position: string; disabled: boolean; winning: boolean}) => {
6-
const value = useCell('board', position, 'value', STORE_ID);
6+
const value = useCell('board', position, 'value', STORE_ID) as string;
77
const currentPlayer = useValue('currentPlayer', STORE_ID);
88

99
const isDisabled = disabled || !!value;

0 commit comments

Comments
 (0)