import $ from 'jquery';
require("./node_modules/bootstrap/dist/css/bootstrap.min.css")
require("./node_modules/bootstrap/js/dropdown.js")
import React from 'react';
import ReactDOM from 'react-dom';
var _ = require('lodash');
Run Code Online (Sandbox Code Playgroud)
请参考上面的设置.有些原因我从dropdown.js 得到错误说" Uncaught ReferenceError:jQuery未定义()"
我还在webpack.config.js中包含以下行
plugins: [
new webpack.NoErrorsPlugin({
$: "jquery",
jQuery: "jquery"
})
]
Run Code Online (Sandbox Code Playgroud)
但是,没有运气 - 仍然有jQuery未定义的错误.任何的想法 ?有人可以帮忙解决这个问题吗?
非常感谢
我在我的应用程序中使用样式组件在CodeSandbox中。请参考以下网址 https://lrn6vmq297.sse.codesandbox.io/
每当我进行一些更改时,控制台都会说。
Warning: Prop `className` did not match.
It looks like you've wrapped styled() around your React component (Component), but the className prop is not being passed down to a child. No styles will be rendered unless className is composed within your React component.
并且UI无法按预期呈现。有人知道我为什么遇到这个问题吗?请查看上面的网址。
谢谢
这是我使用 React 的代码useEffect
const [naked, setNaked] = useState(false);
useEffect(() => {
return () => setNaked(true);
}, [props.onWatch]);
Run Code Online (Sandbox Code Playgroud)
由于某种原因,我遇到以下 eslint 错误:
Unexpected block statement surrounding arrow body arrow-body-style
Run Code Online (Sandbox Code Playgroud)
即使用括号括起来,仍然存在相同的问题:
const [naked, setNaked] = useState(false);
useEffect(() => {
return () => {
setNaked(true);
}
}, [props.onWatch]);
Run Code Online (Sandbox Code Playgroud)
有人有解决这个 eslint 错误的好主意吗?请 ?谢谢