0

I'm trying out scalajsReact with this hello world example:

object ScalaJSExample {

  def main(args: Array[String]): Unit = {
    val NoArgs =
      ScalaComponent.static(<.div("Hello!"))
    NoArgs().renderIntoDOM(document.body)
}

But I get this runtime error: Uncaught ReferenceError:: React.scala:41

I am using scalajsReact 1.7.5 and React 16.13.1.

Am I doing something wrong or is it a bug??

stackoverflowed
  • 686
  • 8
  • 22

1 Answers1

0

Turns out I used https://github.com/vmunier/play-scalajs.g8 to seed my project and somehow the bundling was not done properly using this setup. Base on ScalaJsBundler doc, I replaced WebScalaJS with WebScalaJSBundlerPlugin and I worked.

stackoverflowed
  • 686
  • 8
  • 22