Skip to content

Commit 44ddeb1

Browse files
Update README.md
1 parent 8fcdc88 commit 44ddeb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class CustomComponent extends Component{
6666
return new div([
6767
new p('Hello World', ['style'=> 'color:red;background:blue']),
6868
new div('Many div'),
69-
new button("set my state ($test)", ['onclick'=> "phpReact.setState('$this->id', {test: ".($test+1)."})"]) //in setState must pass the id
70-
], ['style'=> 'border:1px solid #eee;border-radius:4px;max-width:500px;padding:5px;margin:10px', 'id'=> $this->id]); //must add id to generated component id
69+
new button("set my state ($test)", ['onclick'=> "this.setState({test: ".($test+1)."})"])
70+
], ['style'=> 'border:1px solid #eee;border-radius:4px;max-width:500px;padding:5px;margin:10px',]);
7171
}
7272
}
7373
```
@@ -96,8 +96,8 @@ class CustomComponent extends Component{
9696
return new div([
9797
new p('Hello World', ['style'=> 'color:red;background:blue']),
9898
new div('Many div'),
99-
new button("set my state ($test)", ['onclick'=> "phpReact.setState('$this->id', {test: ".($test+1)."})"]) //in setState must pass the id
100-
], ['style'=> 'border:1px solid #eee;border-radius:4px;max-width:500px;padding:5px;margin:10px', 'id'=> $this->id]); //must add id to generated component id
99+
new button("set my state ($test)", ['onclick'=> "this.setState({test: ".($test+1)."})"])
100+
], ['style'=> 'border:1px solid #eee;border-radius:4px;max-width:500px;padding:5px;margin:10px',]); //must add id to generated component id
101101
}
102102
}
103103

0 commit comments

Comments
 (0)