How can I check for empty state and redirect to the first route, if needed?
I have my routes.js
export default (
;
);
and my index.js
const store = configureStore();
console.log({ store });
render(
,
document.getElementById('root')
);
How would I do that using react-router
app.js
import React, { PropTypes } from 'react';
import Header from './common/Header';
import ModalRoot from './modals/Modal';
import Footer from './common/Footer';
class App extends React.Component {
render() {
return (
{this.props.children}
);
}
}
App.propTypes = {
children: PropTypes.object.isRequired,
};
export default App;
No comments:
Post a Comment