Skip to content

Commit e7eeaf2

Browse files
feat: conditionally render FPS counter to avoid displaying NaN values
1 parent 3ddb7dc commit e7eeaf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/game.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function Game() {
7272
/>
7373
</div>
7474
<div className="score-display">{score}</div>
75-
<div className="fps-counter">{Math.round(fps)} FPS</div>
75+
{!isNaN(fps) && <div className="fps-counter">{Math.round(fps)} FPS</div>}
7676
<Unity
7777
unityProvider={unityProvider}
7878
devicePixelRatio={window.devicePixelRatio}

0 commit comments

Comments
 (0)