Skip to content

Instantly share code, notes, and snippets.

@tj tj/preact.go
Created Apr 5, 2017

Embed
What would you like to do?
// Package preact provides bindings to the preact library.
package preact
import "github.com/gopherjs/gopherjs/js"
var preact = js.Global.Get("preact")
// Attrs of an element.
type Attrs map[string]interface{}
// H returns a new element.
func H(v ...interface{}) *js.Object {
return preact.Call("h", v...)
}
// Render function.
func Render(args ...interface{}) {
preact.Call("render", args...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.