@@ -24,6 +24,15 @@ var Hello = createReactClass({
2424});
2525```
2626
27+ ``` jsx
28+ class Hello extends React .Component {
29+ render () {
30+ return < div> Hello< / div> ;
31+ }
32+ static displayName = ' Hello' ;
33+ }
34+ ```
35+
2736Examples of ** correct** code for this rule:
2837
2938``` jsx
@@ -35,6 +44,15 @@ var Hello = createReactClass({
3544});
3645```
3746
47+ ``` jsx
48+ class Hello extends React .Component {
49+ static displayName = ' Hello' ;
50+ render () {
51+ return < div> Hello< / div> ;
52+ }
53+ }
54+ ```
55+
3856## Rule Options
3957
4058This rule can take one argument to customize the components organisation.
@@ -128,6 +146,16 @@ var Hello = createReactClass({
128146});
129147```
130148
149+ ``` jsx
150+ class Hello extends React .Component {
151+ render () {
152+ return < div> Hello< / div> ;
153+ }
154+ onClick = this .onClick .bind (this );
155+ onClick () {}
156+ }
157+ ```
158+
131159Examples of ** correct** code for this rule, with the above configuration:
132160
133161``` jsx
@@ -139,6 +167,16 @@ var Hello = createReactClass({
139167});
140168```
141169
170+ ``` jsx
171+ class Hello extends React .Component {
172+ onClick = this .onClick .bind (this );
173+ onClick () {}
174+ render () {
175+ return < div> Hello< / div> ;
176+ }
177+ }
178+ ```
179+
142180If you want to split your ` render ` method into smaller ones and keep them just before render:
143181
144182``` js
@@ -170,6 +208,17 @@ var Hello = createReactClass({
170208});
171209```
172210
211+ ``` jsx
212+ class Hello extends React .Component {
213+ renderButton = () => {}
214+ onClick = this .onClick .bind (this );
215+ onClick () {}
216+ render () {
217+ return < div> Hello< / div> ;
218+ }
219+ }
220+ ```
221+
173222Examples of ** correct** code for this rule, with the above configuration:
174223
175224``` jsx
@@ -182,6 +231,17 @@ var Hello = createReactClass({
182231});
183232```
184233
234+ ``` jsx
235+ class Hello extends React .Component {
236+ onClick = this .onClick .bind (this );
237+ onClick () {}
238+ renderButton = () => {}
239+ render () {
240+ return < div> Hello< / div> ;
241+ }
242+ }
243+ ```
244+
185245If you want to flow annotations to be at the top:
186246
187247``` js
0 commit comments