codesandbox无法执行'createElement',导出默认名称无效

时间:2018-06-27 06:17:18

标签: javascript codesandbox

此反应组件有什么问题?

const MyHead = () => <h2>this is my head component</h2>;
export default MyHead;

上面的代码给了我错误

> Failed to execute 'createElement' on 'Document': The tag name provided
> ('const MyHead = () => <h2>this is my head component</h2>; export
> default MyHead; ') is not a valid name.

https://codesandbox.io/s/y2vlq0yyxz

0 个答案:

没有答案