0

I have this route,

FlowRouter.route('/dashboard',{
name: 'dashboard',
action(){
    mount(MainLayout, {
        content: (<AW />)
    })
}
});

I imported the AW file.

import React from 'react';
import TrackerReact from 'meteor/ultimatejs:tracker-react';
import UA from './UA.jsx';
export default class AW extends TrackerReact(React.Component){
    constructor(){
        super();
    }
    componentWIllUnmount() {
    }
render(){
    return (
    <div>
        <UA />
        </div>
    )
    }
}

If I removed the <UA /> it is working. If I placed <UA />, it is not working. The error is React.createElement: type should not be null,undefined,boolean, or number.

I tried some editing on the UA file. But unfortunately, nothing works.

Here is the UA file.

import React from 'react';

class UA extends React.Component{
render(){
    return(

        <div>hi</div>
    )
}
}
export default UA;
4
  • This means something is wrong with your import. Commented Dec 2, 2016 at 16:30
  • I don't get it. There is nothing wrong in my codes provided above? Commented Dec 2, 2016 at 16:32
  • If you remove the <UA /> and it works it means that you're not importing from the right place. Commented Dec 2, 2016 at 17:04
  • Could it be that your webpack isn't configured to load .jsx files? You could try renaming to .js, or setting it up as answered here: stackoverflow.com/questions/34678314/… P.S. - .jsx file extension is fine, but not really recommended by Facebook github.com/facebookincubator/create-react-app/issues/… Commented Dec 2, 2016 at 23:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.