Last active
September 11, 2018 13:23
-
-
Save nupurndas/58a184e9d1e0cf4ed93002def83b3f67 to your computer and use it in GitHub Desktop.
TypeError: Cannot read property 'object' of undefined ./src/components/App.js C:/Project/reduxreactcory/src/components/App.js:16 13 | } 14 | 15 | App.Proptypes = { > 16 | children: Proptypes.object.isRequired 17 | }; 18 | 19 | export default App;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component , Proptypes } from 'react'; | |
import './App.css'; | |
class App extends Component { | |
constructor(props) | |
{ | |
super(props); | |
console.log(this.props.data); | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<p>Header here...</p> | |
{this.props.data} | |
</div> | |
); | |
} | |
} | |
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import {Route, Router} from 'react-router'; | |
import {BrowserRouter} from 'react-router-dom'; | |
import {render} from 'react-dom'; | |
import registerServiceWorker from './registerServiceWorker'; | |
import routes from './routes'; | |
import AboutPage from './components/about/AboutPage'; | |
import HomePage from './components/home/HomePage'; | |
import App from './components/App'; | |
render(< App routes={routes} />, | |
document.getElementById('root')); | |
registerServiceWorker(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Route, Switch} from 'react-router'; | |
import App from './components/App'; | |
import HomePage from './components/home/HomePage'; | |
import AboutPage from './components/about/AboutPage'; | |
const routes = () => ( | |
<Switch> | |
<Route exact path="/" component={App}></Route> | |
<Route path="home" component={HomePage} /> | |
<Route path="about" component={AboutPage} /> | |
</Switch> | |
); | |
export default routes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment