-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.go
30 lines (26 loc) · 783 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import "fmt"
func main() {
v := newRenderer([]string{"assets/demo1.js"}).
runCmd(`
var component = React.createElement(CommentBox, { foo: 'bar' });
React.renderToString(component);
`)
fmt.Printf("\n%v\n", v)
v = newRenderer([]string{"assets/demo2.js"}).
runCmd(`
var component = React.createElement(HelloWorld, { foo: 'bar' });
React.renderToString(component);
`)
fmt.Printf("\n%v\n", v)
v = newRenderer([]string{"assets/demo3.js"}).
runCmd(`
var data = [
{"id": 0, "author": "Anonymous", "text": "This is a comment"},
{"id": 1, "author": "Anonymous", "text": "This is another comment"},
]
var component = React.createElement(CommentBox, {data : data});
React.renderToString(component);
`)
fmt.Printf("\n%v\n", v)
}