Skip to content

Instantly share code, notes, and snippets.

@nupurndas
Last active September 11, 2018 13:23
Show Gist options
  • Save nupurndas/58a184e9d1e0cf4ed93002def83b3f67 to your computer and use it in GitHub Desktop.
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;
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;
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();
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