-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
react-ts: make sure react-scripts works, use new jsx runtime (#13)
- Loading branch information
Florens Verschelde
authored
Sep 1, 2023
1 parent
ad31a0e
commit f8e4e62
Showing
4 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import * as React from 'react'; | ||
import { FC } from 'react'; | ||
|
||
import './style.css'; | ||
|
||
export default function App() { | ||
export const App: FC<{ name: string }> = ({ name }) => { | ||
return ( | ||
<div> | ||
<h1>Hello StackBlitz!</h1> | ||
<h1>Hello {name}!</h1> | ||
<p>Start editing to see some magic happen :)</p> | ||
</div> | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import * as React from 'react'; | ||
import { StrictMode } from 'react'; | ||
import { createRoot } from 'react-dom/client'; | ||
|
||
import App from './App'; | ||
import { App } from './App'; | ||
|
||
const rootElement = document.getElementById('root'); | ||
const root = createRoot(rootElement); | ||
const root = createRoot(document.getElementById('root')); | ||
|
||
root.render( | ||
<StrictMode> | ||
<App /> | ||
<App name="StackBlitz" /> | ||
</StrictMode> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"lib": ["DOM", "ES2022"], | ||
"moduleResolution": "node", | ||
"target": "ES2022" | ||
} | ||
} |