Created
August 7, 2017 21:45
-
-
Save shadaj/6382744a4d4bbf824cc1ec69b59e1157 to your computer and use it in GitHub Desktop.
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
package com.apollographql.scalajs | |
import me.shadaj.slinky.web.ReactDOM | |
import me.shadaj.slinky.web.html._ // imports tags, such as "h1" | |
import scala.scalajs.js.JSApp | |
import org.scalajs.dom.{document, html} | |
import scala.scalajs.js | |
object Main extends JSApp { | |
override def main(): Unit = { // called when the app launches | |
val reactContainer = document.createElement("div") | |
document.body.appendChild(reactContainer) | |
ReactDOM.render( | |
h1("hello!"), // this is Scala's version of JSX! | |
reactContainer | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment