Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
159
rated 0 times [  161] [ 2]  / answers: 1 / hits: 17012  / 8 Years ago, mon, december 26, 2016, 12:00:00

I am getting this error while implementing the react-routing here is my code
http://codepen.io/anon/pen/VmOgyy?editors=1010



Error



react.min.js:16 Uncaught Error: Minified React error #130; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at r (react.min.js:16)
at p.a [as _instantiateReactComponent] (react.min.js:16)
at performInitialMount (react.min.js:13)
at p.mountComponent (react.min.js:13)
at Object.mountComponent (react.min.js:15)
at i (react.min.js:14)
at r.perform (react.min.js:16)
at s (react.min.js:14)
at r.perform (react.min.js:16)
at Object.batchedUpdates (react.min.js:14)


Could you please tell me why it is showing this error



var Router = ReactRouter;
var DefaultRoute = Router.DefaultRoute;
var Link = Router.Link;
var Route = Router.Route;
var browserHistory = Router.browserHistory;
var RouteHandler = Router.RouteHandler;

class First extends React.Component {
render() {
return <h1>Hello word</h1>;
}
}

class Second extends React.Component {
render() {
return <h1>Second</h1>;
}
}

ReactDOM.render( <Router history={browserHistory}>
<Route path=/ component={First}/>
</Router>,document.getElementById('root')
)

More From » reactjs

 Answers
2

Well the error occurs because of the conflict between the development and production environment versions of your modules. The react-router instance that you are using in your codepen is a development version and contains the full error messages. And as the React Docs say



In the minified production build of React, we avoid sending down full error messages in order to reduce the number of bytes sent over
the wire.


We highly recommend using the development build locally when debugging
your app since



To solve the error, use the non-minified version of react and react-dom


https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js

and


https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.js

[#59565] Friday, December 23, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
denver

Total Points: 232
Total Questions: 111
Total Answers: 103

Location: South Korea
Member since Sat, Oct 2, 2021
3 Years ago
;