organized types
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { useGame } from "../../src/useGame";
|
||||
import { useKeyBindings } from "./useKeyBindings";
|
||||
import { useMounted } from "./useMounted";
|
||||
import { useIsMobile } from "./useIsMobile";
|
||||
import '../../src/game.css';
|
||||
|
||||
function App() {
|
||||
const isMobile = useIsMobile();
|
||||
const mounted = useMounted();
|
||||
const cols = isMobile ? 12 : 32;
|
||||
const rows = isMobile ? 8 : 24;
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
export const useMounted = () => {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
return mounted;
|
||||
};
|
||||
Reference in New Issue
Block a user