Add TypeScript types for App component

This commit is contained in:
2025-04-15 20:00:20 +02:00
parent e4fb276cf7
commit 46e4897881
4 changed files with 13 additions and 5 deletions

1
app/package-lock.json generated
View File

@@ -36,6 +36,7 @@
"unist-util-visit": "^5.0.0" "unist-util-visit": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/babel__core": "^7.20.5",
"@types/node": "^22.14.0", "@types/node": "^22.14.0",
"@types/react": "^18.3.20", "@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6", "@types/react-dom": "^18.3.6",

View File

@@ -52,6 +52,7 @@
"unist-util-visit": "^5.0.0" "unist-util-visit": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/babel__core": "^7.20.5",
"@types/node": "^22.14.0", "@types/node": "^22.14.0",
"@types/react": "^18.3.20", "@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6", "@types/react-dom": "^18.3.6",

View File

@@ -11,7 +11,9 @@ import '@mantine/core/styles.css';
import '@mantine/notifications/styles.css'; import '@mantine/notifications/styles.css';
import './App.scss'; import './App.scss';
function AuthenticatedContent() { interface AuthenticatedContentProps {}
const AuthenticatedContent: React.FC<AuthenticatedContentProps> = () => {
const { user, loading, initialized } = useAuth(); const { user, loading, initialized } = useAuth();
if (!initialized) { if (!initialized) {
@@ -33,9 +35,11 @@ function AuthenticatedContent() {
</ModalProvider> </ModalProvider>
</WorkspaceProvider> </WorkspaceProvider>
); );
} };
function App() { interface AppProps {}
const App: React.FC<AppProps> = () => {
return ( return (
<> <>
<ColorSchemeScript defaultColorScheme="light" /> <ColorSchemeScript defaultColorScheme="light" />
@@ -49,6 +53,6 @@ function App() {
</MantineProvider> </MantineProvider>
</> </>
); );
} };
export default App; export default App;

View File

@@ -2,7 +2,9 @@ import React from 'react';
import ReactDOM from 'react-dom/client'; import ReactDOM from 'react-dom/client';
import App from './App'; import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root')); const rootElement = document.getElementById('root') as HTMLElement;
const root = ReactDOM.createRoot(rootElement);
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<App /> <App />