Skip to content

Commit eef5f5f

Browse files
committed
refactor: remove unnecessary optional chaining on setters
1 parent a282b6f commit eef5f5f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

example/src/pages/QuickStart.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ export default function QuickStart() {
4141
);
4242

4343
useEffect(() => {
44-
setHealth?.(9);
44+
setHealth(9);
4545
}, [setHealth]);
4646

4747
const handleTakeDamage = () => {
48-
if (health !== undefined && setHealth) {
48+
if (health !== undefined) {
4949
setHealth(health - 7);
5050
riveViewRef?.play();
5151
}
5252
};
5353

5454
const handleMaxHealth = () => {
55-
setHealth?.(100);
55+
setHealth(100);
5656
riveViewRef?.play();
5757
};
5858

5959
const handleGameOver = () => {
60-
setHealth?.(0);
61-
gameOverTrigger?.();
60+
setHealth(0);
61+
gameOverTrigger();
6262
riveViewRef?.play();
6363
};
6464

0 commit comments

Comments
 (0)