Jelajahi Sumber

fix strict mode error

tumao 4 tahun lalu
induk
melakukan
d2d08cd0c9
2 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 2 1
      client/src/context/Root.tsx
  2. 4 1
      client/src/pages/dashboard/Dashboard.tsx

+ 2 - 1
client/src/context/Root.tsx

@@ -1,6 +1,7 @@
 import React, { useState, useCallback } from 'react';
 import {
-  createMuiTheme,
+  // for strict mode
+  unstable_createMuiStrictModeTheme as createMuiTheme,
   ThemeProvider,
   makeStyles,
 } from '@material-ui/core/styles';

+ 4 - 1
client/src/pages/dashboard/Dashboard.tsx

@@ -1,4 +1,5 @@
 import { useContext } from 'react';
+import { useTranslation } from 'react-i18next';
 import { rootContext } from '../../context/Root';
 
 const Dashboard = () => {
@@ -17,9 +18,11 @@ const Dashboard = () => {
     });
   };
 
+  const { t } = useTranslation('btn');
+
   return (
     <section>
-      <button onClick={openDialog}>open</button>
+      <button onClick={openDialog}>{t('confirm')}</button>
     </section>
   );
 };