Skip to content

Commit 6ee3877

Browse files
committed
https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-the-workspace-version-of-typescript
facebook/create-react-app#10144 ^ Fix for the newest version of react 17 and "react-jsx" tag.
1 parent 9fc7cf1 commit 6ee3877

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

src/App.tsx

+30-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
1-
import { Container, Drawer, Grid } from '@material-ui/core';
1+
import React from 'react';
2+
import { Container, Drawer, Grid, ThemeProvider } from '@material-ui/core';
3+
import { createMuiTheme } from '@material-ui/core/styles';
24
import Routes from '@routes';
35
import { StoreProvider } from '@stores';
4-
import React from 'react';
56
import { drawerStyle, wrapperStyle } from '@styles';
67
import './App.css';
78

9+
const theme = createMuiTheme({
10+
palette: {
11+
primary: {
12+
light: '#757ce8',
13+
main: '#3f50b5',
14+
dark: '#002884',
15+
contrastText: '#fff',
16+
},
17+
secondary: {
18+
light: '#ff7961',
19+
main: '#f44336',
20+
dark: '#ba000d',
21+
contrastText: '#000',
22+
},
23+
},
24+
});
25+
826
const App: React.FC = () => {
927
var isIE11 = !!window.MSInputMethodContext;
1028
if (isIE11) alert('(This site is not optimized for IE. Please use Chrome or Firefox or Edge)');
1129
const wrapperCSS = wrapperStyle();
1230
const drawerCSS = drawerStyle();
1331
return (
1432
<StoreProvider>
15-
<Drawer anchor="right" classes={drawerCSS} />
16-
<main className={wrapperCSS.root}>
17-
<Container maxWidth="lg" className={wrapperCSS.container}>
18-
<Grid container spacing={3}>
19-
<Routes />
20-
</Grid>
21-
</Container>
22-
</main>
33+
<ThemeProvider theme={theme}>
34+
<Drawer anchor="right" classes={drawerCSS} />
35+
<main className={wrapperCSS.root}>
36+
<Container maxWidth="lg" className={wrapperCSS.container}>
37+
<Grid container spacing={3}>
38+
<Routes />
39+
</Grid>
40+
</Container>
41+
</main>
42+
</ThemeProvider>
2343
</StoreProvider>
2444
);
2545
};

url-shortner-frontend.code-workspace

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"path": "."
66
}
77
],
8-
"settings": {}
8+
"settings": { "typescript.tsdk": "node_modules/typescript/lib" }
99
}

0 commit comments

Comments
 (0)