I'm trying to display my Deal ponent but I keep getting this error below.
I'm using Meteor with ReactJS.
Uncaught ReferenceError: Deal is not defined at meteorInstall.imports.routes.routes.js
Here is my routes.js file
<Route path="/deals" ponent={Deal} secure="auth" />
My Deal.js ponent file, that the route should be linking too.
import React from 'react';
import { Link } from 'react-router';
import PrivateHeaderNav from './PrivateHeaderNav.js'
export default class Deal extends React.Component {
render() {
return (
<div className="content">
<PrivateHeaderNav/>
Deal
</div>
);
}
}
Am I missing something in the imports or in my Deal ponent?
Thanks
I'm trying to display my Deal ponent but I keep getting this error below.
I'm using Meteor with ReactJS.
Uncaught ReferenceError: Deal is not defined at meteorInstall.imports.routes.routes.js
Here is my routes.js file
<Route path="/deals" ponent={Deal} secure="auth" />
My Deal.js ponent file, that the route should be linking too.
import React from 'react';
import { Link } from 'react-router';
import PrivateHeaderNav from './PrivateHeaderNav.js'
export default class Deal extends React.Component {
render() {
return (
<div className="content">
<PrivateHeaderNav/>
Deal
</div>
);
}
}
Am I missing something in the imports or in my Deal ponent?
Thanks
Share Improve this question asked Apr 28, 2017 at 20:51 calacala 1,4217 gold badges22 silver badges44 bronze badges 4- 1 I think the error message suggests that Deal is not defined, meaning it is not imported, if it is defined in another file. Can you post the import line in from route.js? If the import file path was wrong the error would have been different. – Gratus D. Commented Apr 28, 2017 at 20:54
- @GratusD. yes, I didn't import it in my routes file, that was the error, fixed now. Thanks! – cala Commented Apr 28, 2017 at 20:57
- ops didn't see that ment :) – Sagiv b.g Commented Apr 28, 2017 at 20:58
- @Sag1v No problem :) thanks! – cala Commented Apr 28, 2017 at 20:59
1 Answer
Reset to default 4Your routes.js
file is lacking the import of Deal
ponent.
make sure you have this line in route.js
:
import Deal from './path/to/Deal.js';