wip: setup context + emit

This commit is contained in:
Evan You
2019-06-19 16:43:34 +08:00
parent 08806073a1
commit 5228f0343b
5 changed files with 121 additions and 78 deletions

View File

@@ -68,12 +68,11 @@ test('type inference w/ optional props declaration', () => {
a: 1
}
},
render(props) {
props.msg
render(ctx) {
ctx.msg
ctx.a * 2
this.msg
this.a * 2
// should not make state and this indexable
// state.foobar
// this.foobar
}
})
;(<Comp msg="hello"/>)
@@ -96,9 +95,10 @@ test('type inference w/ array props declaration', () => {
c: 1
}
},
render(props) {
props.a
props.b
render(ctx) {
ctx.a
ctx.b
ctx.c
this.a
this.b
this.c