Instantly share code, notes, and snippets.

Embed
What would you like to do?
...
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