Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit 100fe1d

Browse files
committed
Adding context argument to render
Just a proposal, any chance context could be provided here also? Otherwise we still need `this` / alias if that's in play.
1 parent 3a3e9ee commit 100fe1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

01 - Core/01 - Classes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export class Button extends Component {
3333
this.setState({ counter: this.state.counter + 1 });
3434
}
3535

36-
// Props and state are passed into render as a convenience to avoid the need
37-
// for aliasing or referring to `this`.
38-
render(props, state) {
36+
// Props, state and context are passed into render as a convenience to avoid
37+
// the need for aliasing or referring to `this`.
38+
render(props, state, context) {
3939
return (
4040
<div>
4141
This button has been clicked: {state.counter} times

0 commit comments

Comments
 (0)