我正在尝试使用 React React-dnd 制作 Trello 克隆。 只需输入下面的代码我就会收到错误
const [{ isDragging }, dragRef] = useDrag({
item: { type: "CARD" },
collect: (monitor) => ({
isDragging: monitor.isDragging(),
}),
});
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
必须定义spec.type
invariant
C:/Users/lucca/Documents/GitHub/2B-task/src/index.ts:28
25 | );
26 | } else {
27 | let argIndex = 0;
> 28 | error = new Error(
| ^ 29 | format.replace(/%s/g, function() {
30 | return args[argIndex++];
31 | })
Run Code Online (Sandbox Code Playgroud) 我有一个可压组件,里面有一个图标。我想按下它并旋转180度,我该怎么做?