我有一個非常簡單的作出反應的應用程序使用的WebPack工作下列要求:組件移動到新文件時,React/Webpack應用無效的元素?
export const Row = (props) => {
return <h1>This is a name</h1>;
};
export default class App extends React.Component {
render() {
return (
<Row />
)
}
}
伊夫感動行到它自己的文件,並在我的主文件添加了這個頂部:
import Row from './row';
不過我得到這個錯誤:
warning.js?0260:36 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 `App`.