Skip to content

Commit 44a16a3

Browse files
committed
Simplify examples
Resolves #117.
1 parent 32dc30f commit 44a16a3

11 files changed

+1626
-157
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,10 @@ const nodes = [{
6363
}];
6464

6565
class Widget extends React.Component {
66-
constructor() {
67-
super();
68-
69-
this.state = {
70-
checked: [],
71-
expanded: [],
72-
};
73-
}
66+
state = {
67+
checked: [],
68+
expanded: [],
69+
};
7470

7571
render() {
7672
return (

examples/dist/index.js

Lines changed: 1506 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/src/js/BasicExample.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ const nodes = [
8181
];
8282

8383
class BasicExample extends React.Component {
84-
constructor() {
85-
super();
84+
state = {
85+
checked: [
86+
'/app/Http/Controllers/WelcomeController.js',
87+
'/app/Http/routes.js',
88+
'/public/assets/style.css',
89+
'/public/index.html',
90+
'/.gitignore',
91+
],
92+
expanded: [
93+
'/app',
94+
],
95+
};
8696

87-
this.state = {
88-
checked: [
89-
'/app/Http/Controllers/WelcomeController.js',
90-
'/app/Http/routes.js',
91-
'/public/assets/style.css',
92-
'/public/index.html',
93-
'/.gitignore',
94-
],
95-
expanded: [
96-
'/app',
97-
],
98-
};
97+
constructor(props) {
98+
super(props);
9999

100100
this.onCheck = this.onCheck.bind(this);
101101
this.onExpand = this.onExpand.bind(this);

examples/src/js/ClickableLabelsExample.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,22 @@ const nodes = [
8282

8383
/* eslint-disable react/jsx-one-expression-per-line */
8484
class ClickExample extends React.Component {
85-
constructor() {
86-
super();
85+
state = {
86+
checked: [
87+
'/app/Http/Controllers/WelcomeController.js',
88+
'/app/Http/routes.js',
89+
'/public/assets/style.css',
90+
'/public/index.html',
91+
'/.gitignore',
92+
],
93+
expanded: [
94+
'/app',
95+
],
96+
clicked: {},
97+
};
8798

88-
this.state = {
89-
checked: [
90-
'/app/Http/Controllers/WelcomeController.js',
91-
'/app/Http/routes.js',
92-
'/public/assets/style.css',
93-
'/public/index.html',
94-
'/.gitignore',
95-
],
96-
expanded: [
97-
'/app',
98-
],
99-
clicked: {},
100-
};
99+
constructor(props) {
100+
super(props);
101101

102102
this.onCheck = this.onCheck.bind(this);
103103
this.onClick = this.onClick.bind(this);

examples/src/js/CustomIconsExample.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ const nodes = [
4242
];
4343

4444
class CustomIconsExamples extends React.Component {
45-
constructor() {
46-
super();
45+
state = {
46+
checked: [],
47+
expanded: [
48+
'Documents',
49+
],
50+
};
4751

48-
this.state = {
49-
checked: [],
50-
expanded: [
51-
'Documents',
52-
],
53-
};
52+
constructor(props) {
53+
super(props);
5454

5555
this.onCheck = this.onCheck.bind(this);
5656
this.onExpand = this.onExpand.bind(this);

examples/src/js/DisabledExample.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ const nodes = [
8181
];
8282

8383
class DisabledExample extends React.Component {
84-
constructor() {
85-
super();
84+
state = {
85+
checked: [
86+
'/app/Http/Controllers/WelcomeController.js',
87+
'/app/Http/routes.js',
88+
'/public/assets/style.css',
89+
'/public/index.html',
90+
'/.gitignore',
91+
],
92+
expanded: [
93+
'/app',
94+
],
95+
};
8696

87-
this.state = {
88-
checked: [
89-
'/app/Http/Controllers/WelcomeController.js',
90-
'/app/Http/routes.js',
91-
'/public/assets/style.css',
92-
'/public/index.html',
93-
'/.gitignore',
94-
],
95-
expanded: [
96-
'/app',
97-
],
98-
};
97+
constructor(props) {
98+
super(props);
9999

100100
this.onCheck = this.onCheck.bind(this);
101101
this.onExpand = this.onExpand.bind(this);

examples/src/js/ExpandAllExample.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ const nodes = [
8181
];
8282

8383
class ExpandAllExample extends React.Component {
84-
constructor() {
85-
super();
84+
state = {
85+
checked: [
86+
'/app/Http/Controllers/WelcomeController.js',
87+
'/app/Http/routes.js',
88+
'/public/assets/style.css',
89+
'/public/index.html',
90+
'/.gitignore',
91+
],
92+
expanded: [
93+
'/app',
94+
],
95+
};
8696

87-
this.state = {
88-
checked: [
89-
'/app/Http/Controllers/WelcomeController.js',
90-
'/app/Http/routes.js',
91-
'/public/assets/style.css',
92-
'/public/index.html',
93-
'/.gitignore',
94-
],
95-
expanded: [
96-
'/app',
97-
],
98-
};
97+
constructor(props) {
98+
super(props);
9999

100100
this.onCheck = this.onCheck.bind(this);
101101
this.onExpand = this.onExpand.bind(this);

examples/src/js/HiddenCheckboxesExample.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,23 @@ const nodes = [
8585
];
8686

8787
class HiddenCheckboxesExample extends React.Component {
88-
constructor() {
89-
super();
88+
state = {
89+
checked: [
90+
'persian',
91+
'spqr',
92+
'byzantine',
93+
'holy-roman',
94+
'inca',
95+
],
96+
expanded: [
97+
'favorite-empires',
98+
'classical-era',
99+
'medieval-era',
100+
],
101+
};
90102

91-
this.state = {
92-
checked: [
93-
'persian',
94-
'spqr',
95-
'byzantine',
96-
'holy-roman',
97-
'inca',
98-
],
99-
expanded: [
100-
'favorite-empires',
101-
'classical-era',
102-
'medieval-era',
103-
],
104-
};
103+
constructor(props) {
104+
super(props);
105105

106106
this.onCheck = this.onCheck.bind(this);
107107
this.onExpand = this.onExpand.bind(this);

examples/src/js/LargeDataExample.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ const nodes = [{
2727
}];
2828

2929
class LargeDataExample extends React.Component {
30-
constructor() {
31-
super();
30+
state = {
31+
checked: [],
32+
expanded: [],
33+
};
3234

33-
this.state = {
34-
checked: [],
35-
expanded: [],
36-
};
35+
constructor(props) {
36+
super(props);
3737

3838
this.onCheck = this.onCheck.bind(this);
3939
this.onExpand = this.onExpand.bind(this);

examples/src/js/NoCascadeExample.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ const nodes = [
8181
];
8282

8383
class NoCascadeExample extends React.Component {
84-
constructor() {
85-
super();
84+
state = {
85+
checked: [
86+
'/app/Http/Controllers/WelcomeController.js',
87+
'/app/Http/routes.js',
88+
'/public/assets/style.css',
89+
'/public/index.html',
90+
'/.gitignore',
91+
],
92+
expanded: [
93+
'/app',
94+
'/app/Http',
95+
],
96+
};
8697

87-
this.state = {
88-
checked: [
89-
'/app/Http/Controllers/WelcomeController.js',
90-
'/app/Http/routes.js',
91-
'/public/assets/style.css',
92-
'/public/index.html',
93-
'/.gitignore',
94-
],
95-
expanded: [
96-
'/app',
97-
'/app/Http',
98-
],
99-
};
98+
constructor(props) {
99+
super(props);
100100

101101
this.onCheck = this.onCheck.bind(this);
102102
this.onExpand = this.onExpand.bind(this);

0 commit comments

Comments
 (0)