我想在laravel + react中实现asyncComponent。在尝试asyncComponent之前,一切正常。
当我尝试返回错误时:
代码:
import asyncComponent from '../component/asyncComponent';
const Home = asyncComponent(() => import('../pages/home') //line 9
.then(module => module.default), { name: 'Home' });
错误:
模块构建失败:SyntaxError: E:/xampp/htdocs/react/lara-react/blog-new/resources/js/back-end/layout/main.js: 意外令牌(9:34)
如何在laravel中实现asyncComponent?