removing JSX leftovers
Massimo Melina committed
Feb 5, 2022 at 12:40 UTC
be3a27d9d73c74367c7ca2733e8f9a35e870d9a1
6 files changed
+13
-20
admin/src/App.test.ts
renamed
+1
-1
@@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
3
import App from './App';
4
5
test('renders learn react link', () => {
6
- render(<App />);
6
+ render(React.createElement(App));
7
const linkElement = screen.getByText(/learn react/i);
8
expect(linkElement).toBeInTheDocument();
9
});
admin/src/App.ts
+2
-2
@@ -1,5 +1,5 @@
1
-import { createElement as h } from 'react';
2
-import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom';
1
+import { createElement as h } from 'react'
2
+import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom'
3
import MainMenu, { getMenuLabel, mainMenu } from './MainMenu'
4
import { Box, ThemeProvider, Typography } from '@mui/material'
5
import { Dialogs } from './dialog'
admin/src/index.ts
renamed
+5
-9
@@ -1,17 +1,13 @@
1
-import React from 'react';
1
+import { createElement as h, StrictMode } from 'react';
2
import ReactDOM from 'react-dom';
3
import './index.css';
4
import App from './App';
5
-import reportWebVitals from './reportWebVitals';
5
+//import reportWebVitals from './reportWebVitals';
6
7
-ReactDOM.render(
8
- <React.StrictMode>
9
- <App />
10
- </React.StrictMode>,
11
- document.getElementById('root')
12
-);
7
+ReactDOM.render( h(StrictMode, {}, h(App)),
8
+ document.getElementById('root'))
9
10
// If you want to start measuring performance in your app, pass a function
11
// to log results (for example: reportWebVitals(console.log))
12
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17
-reportWebVitals();
13
+//reportWebVitals();
frontend/src/App.test.ts
renamed
+1
-1
@@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
3
import App from './App';
4
5
test('renders learn react link', () => {
6
- render(<App/>);
6
+ render(React.createElement(App));
7
const linkElement = screen.getByText(/learn react/i);
8
expect(linkElement).toBeInTheDocument();
9
});
frontend/src/App.ts
renamed
+2
-2
@@ -1,8 +1,8 @@
1
import { BrowserRouter, Route, Routes } from "react-router-dom"
2
import { createElement as h, Fragment } from 'react'
3
-import { BrowseFiles } from "./BrowseFiles";
3
+import { BrowseFiles } from "./BrowseFiles"
4
import { Dialogs } from './dialog'
5
-import useTheme from "./useTheme";
5
+import useTheme from "./useTheme"
6
7
function App() {
8
useTheme()
frontend/src/index.ts
renamed
+2
-5
@@ -1,14 +1,11 @@
1
-import React from 'react';
1
+import { createElement as h, StrictMode } from 'react';
2
import ReactDOM from 'react-dom';
3
import './index.scss';
4
import './min-crypto-polyfill'
5
import App from './App';
6
//import reportWebVitals from './reportWebVitals';
7
8
-ReactDOM.render(
9
- <React.StrictMode>
10
- <App/>
11
- </React.StrictMode>,
8
+ReactDOM.render(h(StrictMode, {}, h(App)),
9
document.getElementById('root')
10
);
11