小编Hor*_*ora的帖子

spec.type 必须在react-dnd中定义

我正在尝试使用 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)

javascript reactjs react-dnd

8
推荐指数
2
解决办法
9824
查看次数

如何在React Native中按下一个组件并使其旋转180度?

我有一个可压组件,里面有一个图标。我想按下它并旋转180度,我该怎么做?

animation react-native

5
推荐指数
1
解决办法
2964
查看次数

标签 统计

animation ×1

javascript ×1

react-dnd ×1

react-native ×1

reactjs ×1