I am trying to import a React component Menu.jsx from App.jsx in my Electron app. No errors are showing up, but nothing is being rendered and are not added to the DOM (the body is empty when I looked at the devtools). Not even the heading is being added.
App.jsx:
import * as React from "react";
import { createRoot } from "react-dom/client";
import Menu from "./components/Menu.jsx";
function App() {
return (
<>
<h1 style={{ margin: "0 0 2rem 0" }}>Let's Start Training!</h1>
<Menu />
</>
);
}
const root = createRoot(document.body);
root.render(<App />);
components/Menu.jsx:
export default function Menu() {
return (
<div className="vbox" style={{ width: "16rem" }}>
<button>Times Table</button>
<button>Addition</button>
<button>Both</button>
</div>
);
}
When I put the Menu() component directly in App.jsx, everything is being rendered correctly. When I remove the line <Menu /> from App.jsx, at least the heading is being rendered.
