react-dnd Flashcards

1
Q

what helps. react-dnd interact with dom

A

monitors: it is the way, react-dnd collects information what is happening

react-dnd creates state from events noted in monitor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how react-dnd give data to react components

A

collector function

react component gets props through collector function which convert Dnd state into props

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a backend in react-dnd, types

A

backend is an abstraction over the dom, which outputs information about what drag and drop events are happening in the dom.

there are two types: 1. html-backend 2. touch-backend 3. Test: supports testing dnd interactions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

drag sources

A

they are draggable component
carries information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

drop targets

A

accept draggables
can execute functions based on events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how to convert a component into draggable

A

useDrag hook, it accepts, {item, collect} as props

it wires the component into a drag source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

return value of useDrag hook

A
  1. ref to be attached to drag source
  2. collected props
  3. drag preview elements Ref: A connector function for the drag preview. This may be attached to the preview portion of the DOM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly