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;
Dave Newton
  • 158,873
  • 26
  • 254
  • 302
JMA
  • 974
  • 3
  • 13
  • 41
  • This means something is wrong with your import. – Dave Newton Dec 02 '16 at 16:30
  • I don't get it. There is nothing wrong in my codes provided above? – JMA Dec 02 '16 at 16:32
  • If you remove the `` and it works it means that you're not importing from the right place. – Dave Newton Dec 02 '16 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: http://stackoverflow.com/questions/34678314/webpack-cant-find-module-if-file-named-jsx P.S. - .jsx file extension is fine, but not really recommended by Facebook https://github.com/facebookincubator/create-react-app/issues/87#issuecomment-234627904 – Jeff McCloud Dec 02 '16 at 23:00

0 Answers0