-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sam Bot
committed
Jul 30, 2023
1 parent
2c7ede8
commit b615b11
Showing
4 changed files
with
61 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react' | ||
import * as ReactDOM from 'react-dom/client' | ||
|
||
class Hello extends React.Component<{}, {}> { | ||
public render() { | ||
return ( | ||
<div> | ||
Hello World! | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
// TODO: investigate whether unmount is needed | ||
// github.com/reactjs/react-rails/issues/1028#issuecomment-862475500 | ||
// | ||
document.addEventListener("turbo:load", () => { | ||
const root = ReactDOM.createRoot(document.getElementById("hello-react-mount-point")); | ||
root.render( | ||
<React.StrictMode> | ||
<Hello /> | ||
</React.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
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