import React, {
useState } from "react";
import styled from "styled-components";
import {
DragDropContext,
Draggable,
DraggableProvided,
DraggableRubric,
DraggableStateSnapshot,
DragStart,
DragUpdate,
Droppable,
DropResult,
ResponderProvided,
} from "react-beautiful-dnd";
import "./styles.css";
interface IItem {
id: string;
label: string;
}
export const DndForm: React.FC = () => {
const COLLECTION: IItem[] = [
{
id: "1", label: "Apple" },
{
id: "2", label: "Banana" },
{
id: "3", label: "orange" },
];
const [items, setItems] = useState<IItem[]>(COLLECTION);
const [enabled, setEnabled] = React.useState(false);
React.useEffect(() => {
const animation = requestAnimationFrame(() => setEnabled(true))
rbd(react-beautiful-dnd)-拖动时copy一个新的元素占据原来的位置
于 2023-03-26 18:53:50 首次发布