Error
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of
Switch.jsx
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import { SwitchUnit } from './sitch_unit.jsx';
export default class MySwitch extends Component{
constructor(props) {
super(props);
}
render(){
return(<div>
<SwitchUnit />
<SwitchUnit />
</div>
);
}
}
sitch_unit.jsx
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
export default class SwitchUnit extends Component{
constructor(props) {
super(props);
}
render(){
return(
<div className="xxx">xxx</div>
);
}
}