React/Redux - publish component #323
|
@ -18,7 +18,6 @@ class Preview extends React.Component {
|
||||||
Generally you should avoid doing dom stuff/setting state in
Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version.
`componentDidMount` is preferred
|
|||||||
this.previewFile(newProps.file);
|
this.previewFile(newProps.file);
|
||||||
}
|
}
|
||||||
if (newProps.thumbnail !== this.props.thumbnail) {
|
if (newProps.thumbnail !== this.props.thumbnail) {
|
||||||
console.log('updating thumbnail', this.props.thumbnail);
|
|
||||||
Generally you should avoid doing dom stuff/setting state in
Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version.
`componentDidMount` is preferred
|
|||||||
this.setState({imgSource: (newProps.thumbnail || this.state.defaultThumbnail)});
|
this.setState({imgSource: (newProps.thumbnail || this.state.defaultThumbnail)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Generally you should avoid doing dom stuff/setting state in
Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version.
`componentDidMount` is preferred
Generally you should avoid doing dom stuff/setting state in
Generally you should avoid doing dom stuff/setting state in `componentWillMount`. Especially since it seems that they will be removing it in a future React version.
`componentDidMount` is preferred
|
|
@ -42,7 +42,6 @@ class NavBar extends React.Component {
|
||||||
// check for whether a channel is already logged in
|
// check for whether a channel is already logged in
|
||||||
let channelName, channelShortId, channelLongId;
|
let channelName, channelShortId, channelLongId;
|
||||||
({ channelName, channelShortId, channelLongId } = getUserCookies());
|
({ channelName, channelShortId, channelLongId } = getUserCookies());
|
||||||
console.log(`userCookies`, getUserCookies());
|
|
||||||
console.log(`cookies found for channel: ${channelName} ${channelShortId} ${channelLongId}`);
|
console.log(`cookies found for channel: ${channelName} ${channelShortId} ${channelLongId}`);
|
||||||
this.props.onChannelLogin(channelName, channelShortId, channelLongId);
|
this.props.onChannelLogin(channelName, channelShortId, channelLongId);
|
||||||
}
|
}
|
||||||
|
|
Generally you should avoid doing dom stuff/setting state in
componentWillMount
. Especially since it seems that they will be removing it in a future React version.componentDidMount
is preferred