React TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined
I am making a react app using routers. It has 2 routers; post and profile. The code for them is as below:
Posts: import React,{Component} from 'react';
class Posts extends Component{
render(){
return <div> Posts </div>
}
}
export default Posts;
Profile:import React,{Component} from 'react';
class Profile extends Component{
render(){
return <div> Profile </div>
}
}
export default Profile;
and the index.js is:import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter, Route} from 'react-router-dom';
import PropTypes from 'prop-types';
//COMPONENTS
import Posts from './Components/posts';
import Profile from './Components/profile';
class App extends Component{
render(){
return <div> home </div>
}
}
ReactDOM.render(
<BrowserRouter>
<div>
<Route path="/posts" component={Posts}> </Route>
<Route path="/profile" component={Profile}> </Route>
</div>
</BrowserRouter>
,document.querySelector('#root'))
I am getting the following error: React TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined
Here is a screenshot of the error: https://imgur.com/6ijKefx
and I can't figure it out. What am I doing wrong?
reactjs react-router
add a comment |
I am making a react app using routers. It has 2 routers; post and profile. The code for them is as below:
Posts: import React,{Component} from 'react';
class Posts extends Component{
render(){
return <div> Posts </div>
}
}
export default Posts;
Profile:import React,{Component} from 'react';
class Profile extends Component{
render(){
return <div> Profile </div>
}
}
export default Profile;
and the index.js is:import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter, Route} from 'react-router-dom';
import PropTypes from 'prop-types';
//COMPONENTS
import Posts from './Components/posts';
import Profile from './Components/profile';
class App extends Component{
render(){
return <div> home </div>
}
}
ReactDOM.render(
<BrowserRouter>
<div>
<Route path="/posts" component={Posts}> </Route>
<Route path="/profile" component={Profile}> </Route>
</div>
</BrowserRouter>
,document.querySelector('#root'))
I am getting the following error: React TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined
Here is a screenshot of the error: https://imgur.com/6ijKefx
and I can't figure it out. What am I doing wrong?
reactjs react-router
add a comment |
I am making a react app using routers. It has 2 routers; post and profile. The code for them is as below:
Posts: import React,{Component} from 'react';
class Posts extends Component{
render(){
return <div> Posts </div>
}
}
export default Posts;
Profile:import React,{Component} from 'react';
class Profile extends Component{
render(){
return <div> Profile </div>
}
}
export default Profile;
and the index.js is:import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter, Route} from 'react-router-dom';
import PropTypes from 'prop-types';
//COMPONENTS
import Posts from './Components/posts';
import Profile from './Components/profile';
class App extends Component{
render(){
return <div> home </div>
}
}
ReactDOM.render(
<BrowserRouter>
<div>
<Route path="/posts" component={Posts}> </Route>
<Route path="/profile" component={Profile}> </Route>
</div>
</BrowserRouter>
,document.querySelector('#root'))
I am getting the following error: React TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined
Here is a screenshot of the error: https://imgur.com/6ijKefx
and I can't figure it out. What am I doing wrong?
reactjs react-router
I am making a react app using routers. It has 2 routers; post and profile. The code for them is as below:
Posts: import React,{Component} from 'react';
class Posts extends Component{
render(){
return <div> Posts </div>
}
}
export default Posts;
Profile:import React,{Component} from 'react';
class Profile extends Component{
render(){
return <div> Profile </div>
}
}
export default Profile;
and the index.js is:import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter, Route} from 'react-router-dom';
import PropTypes from 'prop-types';
//COMPONENTS
import Posts from './Components/posts';
import Profile from './Components/profile';
class App extends Component{
render(){
return <div> home </div>
}
}
ReactDOM.render(
<BrowserRouter>
<div>
<Route path="/posts" component={Posts}> </Route>
<Route path="/profile" component={Profile}> </Route>
</div>
</BrowserRouter>
,document.querySelector('#root'))
I am getting the following error: React TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined
Here is a screenshot of the error: https://imgur.com/6ijKefx
and I can't figure it out. What am I doing wrong?
reactjs react-router
reactjs react-router
asked Apr 4 '18 at 15:43
hkjhadj1hkjhadj1
46111
46111
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
What version of React are you using?
I got this error when upgrading to React 16, and changing my react lines in package.json to:
"react-dom": "^15.1.1",
"react": "^15.1.1",
and then running npm install
and npm start
fixed it for me.
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
add a comment |
I had the same problem and late noticed that I had a typo in my import statement.
Instead of:
import React from "react"
I had:
import {React} from "react"
add a comment |
fixed it in "react-dom": "^16.6.3",by changing
import React,{Component} from 'react';
class App extends Component{
render(){
return <div> home </div>
}
}
to
import React from 'react';
class App extends React.Component{
render(){
return <div> home </div>
}
}
Hope it helps :)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49655272%2freact-typeerror-webpack-imported-module-0-react-proptypes-is-undefined%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
What version of React are you using?
I got this error when upgrading to React 16, and changing my react lines in package.json to:
"react-dom": "^15.1.1",
"react": "^15.1.1",
and then running npm install
and npm start
fixed it for me.
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
add a comment |
What version of React are you using?
I got this error when upgrading to React 16, and changing my react lines in package.json to:
"react-dom": "^15.1.1",
"react": "^15.1.1",
and then running npm install
and npm start
fixed it for me.
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
add a comment |
What version of React are you using?
I got this error when upgrading to React 16, and changing my react lines in package.json to:
"react-dom": "^15.1.1",
"react": "^15.1.1",
and then running npm install
and npm start
fixed it for me.
What version of React are you using?
I got this error when upgrading to React 16, and changing my react lines in package.json to:
"react-dom": "^15.1.1",
"react": "^15.1.1",
and then running npm install
and npm start
fixed it for me.
answered Apr 16 '18 at 21:05
NH.NH.
92411230
92411230
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
add a comment |
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
How can downgrading possibly be the right solution to this issue?
– silkfire
Nov 27 '18 at 20:58
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
@silkfire IKR?! This is a workaround until React fixes the issue.
– NH.
Nov 28 '18 at 23:17
add a comment |
I had the same problem and late noticed that I had a typo in my import statement.
Instead of:
import React from "react"
I had:
import {React} from "react"
add a comment |
I had the same problem and late noticed that I had a typo in my import statement.
Instead of:
import React from "react"
I had:
import {React} from "react"
add a comment |
I had the same problem and late noticed that I had a typo in my import statement.
Instead of:
import React from "react"
I had:
import {React} from "react"
I had the same problem and late noticed that I had a typo in my import statement.
Instead of:
import React from "react"
I had:
import {React} from "react"
answered Nov 27 '18 at 20:54
EriccurEriccur
212
212
add a comment |
add a comment |
fixed it in "react-dom": "^16.6.3",by changing
import React,{Component} from 'react';
class App extends Component{
render(){
return <div> home </div>
}
}
to
import React from 'react';
class App extends React.Component{
render(){
return <div> home </div>
}
}
Hope it helps :)
add a comment |
fixed it in "react-dom": "^16.6.3",by changing
import React,{Component} from 'react';
class App extends Component{
render(){
return <div> home </div>
}
}
to
import React from 'react';
class App extends React.Component{
render(){
return <div> home </div>
}
}
Hope it helps :)
add a comment |
fixed it in "react-dom": "^16.6.3",by changing
import React,{Component} from 'react';
class App extends Component{
render(){
return <div> home </div>
}
}
to
import React from 'react';
class App extends React.Component{
render(){
return <div> home </div>
}
}
Hope it helps :)
fixed it in "react-dom": "^16.6.3",by changing
import React,{Component} from 'react';
class App extends Component{
render(){
return <div> home </div>
}
}
to
import React from 'react';
class App extends React.Component{
render(){
return <div> home </div>
}
}
Hope it helps :)
answered Dec 22 '18 at 4:53
EphemeralEphemeral
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49655272%2freact-typeerror-webpack-imported-module-0-react-proptypes-is-undefined%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown