I am trying to set up routing in Meteor
using react-router
package and have encountered the following TypeError
:
Assuming you are importing Component
as a React.Component
correctly, try removing the parenthesis after Component.
Should be:
class Portfolio extends Component {
instead of:
class Portfolio extends Component () {
If not, replace Component
with React.Component
.
The answer provided by kctang is right, that
use :
class Portfolio extends Component {
instead of:
class Portfolio extends Component () {}
I wanna add the cause of it ?? In object-oriented programing it's called inheritance, when you extend/inherit a class to use its component, you called by its name and it's not function. here you extend Component class not function, that's why you don't use parenthesis and also function need a parameter.