Created
February 8, 2019 15:06
-
-
Save anthony-cros/f89dd3eafc5ce05cc43ec59ef87b24ac 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
... | |
val shoppingList = new ShoppingList() | |
Bindings.ReactDOM.render( | |
element = shoppingList, // js console ERROR: Uncaught Error: Objects are not valid as a React child (found: object with keys {props, context, refs, updater}). If you meant to render a collection of children, use an array instead | |
container = org.scalajs.dom.document.getElementById("container")) // sByClassName("myapp")(0) | |
} | |
@ScalaJSDefined | |
class ShoppingList( | |
jsProps: js.Object = js.Object.apply(), | |
context: js.Any = null, | |
updater: js.Any = null) | |
extends Bindings.Component() { | |
} | |
object Bindings { | |
... | |
@JSImport(/* module */ "react", /* name */ "Component", /* globalFallback */ "React.Component") | |
@js.native | |
class Component( | |
jsProps: js.Object = js.Object.apply(), | |
context: js.Any = null, | |
updater: js.Any = null) | |
extends js.Object { | |
val constructor: js.Any = js.native | |
def render(): js.Any = js.native | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment