I recently added a mapStateToProps in my top level element: As you can see I have two conditional renderings that might be causing the issue ...
... yes SO, this is mostly code, supposedly setState is causing a warning for some reason ...
App
// ... snip ... inside React class
render () {
return (
<div id='app_hold'>
<F1Apex/>
{this.props.App.current && <FastApp/>}
{!this.props.App.current && <FaviconApp/>}
</div>
)
}
}
const mapStateToProps = state => {
return {
App: state.App
}
}
const AppRedux = connect(mapStateToProps)(App);
ReactDOM.render(
<Provider store={store}>
<AppRedux></AppRedux>
</Provider>
, document.getElementById('app'));
and am now getting a warning:
FastApp
import React from 'react';
import { connect } from 'react-redux';
import './FastApp.css';
class FastApp extends React.Component {
constructor(props) {
super(props);
this.state = {
greeting: 'Hello ',
time: '00:00:00 AM',
image: 'none'
}
}
componentDidMount () {
this.setImageAndGreet(); // calls setState()
this.showTime(); // calls setState()
}
// ... snip
render () {} // uses this.state which was set by this.setState()