Ver código fonte

feat(home): viewMap keys

lind 3 anos atrás
pai
commit
acd98a0263
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      src/pages/home/index.tsx

+ 3 - 1
src/pages/home/index.tsx

@@ -11,8 +11,10 @@ const ViewMap = {
   ops: <Ops />,
 };
 
+type ViewType = keyof typeof ViewMap;
+
 const Home = () => {
-  const [current, setCurrent] = useState<'init' | 'device' | 'ops'>('init');
+  const [current, setCurrent] = useState<ViewType>('init');
 
   return (
     <PageContainer>