Skip to content

Commit 019ae64

Browse files
committed
fix react warnings
1 parent a7073c8 commit 019ae64

7 files changed

Lines changed: 37 additions & 10 deletions

File tree

src/components/FacebookLogin/FacebookLogin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class FacebookLogin extends React.Component {
77
xfbml: PropTypes.bool,
88
cookie: PropTypes.bool,
99
scope: PropTypes.string,
10-
autoLoad: PropTypes.bool.isRequired,
10+
autoLoad: PropTypes.bool,
1111
version: PropTypes.string,
1212
language: PropTypes.string,
1313
textButton: PropTypes.string,
@@ -25,7 +25,8 @@ class FacebookLogin extends React.Component {
2525
cookie: false,
2626
version: '2.3',
2727
language: 'en_US',
28-
};
28+
autoLoad: false
29+
}
2930

3031
componentDidMount() {
3132
const { appId, xfbml, cookie, version, autoLoad, language } = this.props;

src/components/InfoBar/InfoBar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ import { load } from 'redux/modules/info';
77
{ load })
88
export default class InfoBar extends Component {
99
static propTypes = {
10-
info: PropTypes.object.isRequired,
10+
info: PropTypes.object,
1111
load: PropTypes.func.isRequired
1212
}
1313

14+
static defaultProps = {
15+
info: null
16+
};
17+
1418
render() {
1519
const { info, load } = this.props; // eslint-disable-line no-shadow
1620
const styles = require('./InfoBar.scss');

src/components/SurveyForm/SurveyForm.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function asyncValidate(data, dispatch) {
2323
export default
2424
class SurveyForm extends Component {
2525
static propTypes = {
26-
active: PropTypes.string.isRequired,
26+
active: PropTypes.string,
2727
asyncValidating: PropTypes.oneOfType([
2828
PropTypes.bool,
2929
PropTypes.string
@@ -36,6 +36,10 @@ class SurveyForm extends Component {
3636
valid: PropTypes.bool.isRequired
3737
}
3838

39+
static defaultProps = {
40+
active: null
41+
}
42+
3943
renderInput = ({
4044
input, label, type, showAsyncValidating, className, styles,
4145
meta: { touched, error, dirty, active, visited, asyncValidating }

src/containers/App/App.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ import { asyncConnect } from 'redux-connect';
3636
export default class App extends Component {
3737
static propTypes = {
3838
children: PropTypes.object.isRequired,
39-
user: PropTypes.object.isRequired,
39+
user: PropTypes.object,
4040
notifs: PropTypes.object.isRequired,
4141
logout: PropTypes.func.isRequired,
4242
pushState: PropTypes.func.isRequired
4343
};
4444

45+
static defaultProps = {
46+
user: null
47+
};
48+
4549
static contextTypes = {
4650
store: PropTypes.object.isRequired
4751
};

src/containers/Chat/Chat.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import { socket } from 'app';
88
export default class Chat extends Component {
99

1010
static propTypes = {
11-
user: PropTypes.object.isRequired
11+
user: PropTypes.object
1212
};
1313

14+
static defaultProps = {
15+
user: null
16+
}
17+
1418
state = {
1519
message: '',
1620
messages: []

src/containers/Login/Login.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ import * as notifActions from 'redux/modules/notifs';
1111
{ ...notifActions, ...authActions })
1212
export default class Login extends Component {
1313
static propTypes = {
14-
user: PropTypes.object.isRequired,
14+
user: PropTypes.object,
1515
login: PropTypes.func.isRequired,
1616
logout: PropTypes.func.isRequired,
1717
notifSend: PropTypes.func.isRequired
1818
}
1919

20+
static defaultProps = {
21+
user: null
22+
}
23+
2024
static contextTypes = {
2125
router: PropTypes.object
2226
}

src/containers/Widgets/Widgets.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@ const { isLoaded, load: loadWidgets } = widgetActions;
2525
{ ...widgetActions })
2626
export default class Widgets extends Component {
2727
static propTypes = {
28-
widgets: PropTypes.array.isRequired,
29-
error: PropTypes.string.isRequired,
30-
loading: PropTypes.bool.isRequired,
28+
widgets: PropTypes.array,
29+
error: PropTypes.string,
30+
loading: PropTypes.bool,
3131
editing: PropTypes.object.isRequired,
3232
load: PropTypes.func.isRequired,
3333
editStart: PropTypes.func.isRequired
3434
};
3535

36+
static defaultProps = {
37+
widgets: null,
38+
error: null,
39+
loading: false
40+
}
41+
3642
render() {
3743
const handleEdit = widget => {
3844
const { editStart } = this.props;

0 commit comments

Comments
 (0)