File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ class Button extends Component {
37
37
</button>
38
38
';
39
39
40
+ @:story
41
+ @:state(var value:Int = 0) // add state to a story
42
+ function withState() '
43
+ <button onclick=${value += 1}>
44
+ Clicked ${value} time(s)
45
+ </button>
46
+ ';
47
+
40
48
function wrap(f:()->ReactSingleFragment) '
41
49
<div style=${{backgroundColor: 'black'}}>${f()}</div>
42
50
';
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Setup {
17
17
for (field in builder )
18
18
switch [field .kind , field .metaNamed (' :story' ), field .metaNamed (' :state' )] {
19
19
case [FFun (func ), stories , v ] if (stories .length > 0 ):
20
- // wrap with Isolated
20
+ // wrap with Isolated, so changes will trigger re-render
21
21
function subst (e : Expr )
22
22
return switch e {
23
23
case macro return $ret :
You can’t perform that action at this time.
0 commit comments