make typescript compilation work
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
import React from 'react'
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
|
||||
self.$RefreshReg$ = () => {};
|
||||
self.$RefreshSig$ = () => () => {};
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const root = createRoot(container); // createRoot(container!) if you use TypeScript
|
||||
root.render(<App />);
|
||||
@@ -0,0 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const root = createRoot(container!);
|
||||
root.render(<App />);
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
"target": "es5",
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
"moduleResolution": "node"
|
||||
"moduleResolution": "node",
|
||||
"jsx": "react",
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ module.exports = env => {
|
||||
global.$RefreshSig$ = () => () => {};
|
||||
|
||||
return {
|
||||
entry: ["./client/src/index.js"],
|
||||
entry: ["./client/src/index.tsx"],
|
||||
mode: isDevelopment ? 'development' : 'production',
|
||||
module: {
|
||||
rules: [
|
||||
|
||||
Reference in New Issue
Block a user