我按照本手册开发应用程序,可以使用Axios或Fetch API将API请求从前端(React app)发送到后端(Express) https://hackernoon.com/full-stack-web-application-using -react节点-JS-EXPRESS-和的WebPack-97dbd5b9d708
本手册非常好,几乎满足了我的所有需求,除了一个。 我想使用“JQWidgets”中的一些组件。
所以当我向package.json添加npm包“jqwidgets-scripts”时
"jqwidgets-scripts": "~6.0.5"
并只导入一个组件
import JqxButton from "jqwidgets-scripts/jqwidgets-react/react_jqxbuttons";
我收到错误
./node_modules/jqwidgets-scripts/jqwidgets-react/react_jqxbuttons.js 217:12
Module parse failed: Unexpected token (217:12)
You may need an appropriate loader to handle this file type.
| this.componentSelector = '#' + id;
| return (
> <div id={id}>{this.props.value}{this.props.children}</div>
| )
| };
我还尝试使用官方指南达到目标,使用此页面中包含React,Express,Webpack和JQWidgets的工具进行开发https://www.jqwidgets.com/reactjs-components-documentation/documentation/webpack_react/index.htm
所有工作除了发送API请求的可能性外。
那么如何编译两个配置以使用JQWidgets和API请求后端部分?