redenergy
11/16/2020, 12:07 AMsrc/app/App.js
and src/index/index.kt
. App.js exports a react component which I want to render in index.kt. How do I do this?
index.kt
package index
import kotlinext.js.*
import react.dom.*
import kotlinx.browser.*
fun main(args: Array<String>) {
requireAll(require.context("src", true, js("/\\.css$/")))
render(document.getElementById("root")) {
// Need to render App.js here
}
}
App.js
import React from "react";
function App() {
return (
<div>
<span>Hello World!</span>
</div>
);
}
export default App;