add react
This commit is contained in:
@@ -1 +0,0 @@
|
||||
console.log('Hello, Typescript!')
|
||||
14
app/javascript/application.tsx
Normal file
14
app/javascript/application.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
const container = document.getElementById('app');
|
||||
|
||||
const App = () => {
|
||||
return (<div>Hello, Rails 7!</div>)
|
||||
}
|
||||
|
||||
if (container) {
|
||||
const root = createRoot(container); // createRoot(container!) if you use TypeScript
|
||||
|
||||
root.render(<App />);
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
<h1>Entrypoint#index</h1>
|
||||
<p>Find me in app/views/entrypoint/index.html.erb</p>
|
||||
<div id="app"></div>
|
||||
Reference in New Issue
Block a user