You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the test backend to start a drag operation, I get the following error:
Invariant Violation: Expected a valid source ID.
Looking at the source, it looks like it's coming from parseRoleFromHandlerId, which expects the ID to start with either S for a drag source, or T for a drop target. My component is both, and its ID is "T12", so it's not recognized as a drag source by the test backend.
From the examples, I gathered that this use-case is a supported one, but it would be nice to be able to test it.
The text was updated successfully, but these errors were encountered:
importMyComponent,{MyComponentDragSource}from'../MyComponent';// ...// Inside testconstroot=TestUtils.renderIntoDocument(<MyComponent/>);constbackend=root.getManager().getBackend();constitem=TestUtils.findRenderedComponentWithType(root,MyComponentDragSource);// Notice we find the DragSource, not the regular component: ^^^^^^^^^^backend.simulateBeginDrag([item.getHandlerId()]);// Will work now// ...
I have a component in my app that is both a drag source and a drop target, exactly like in this example: https://github.com/gaearon/react-dnd/blob/master/examples/04%20Sortable/Simple/Card.js#L92
When I use the test backend to start a drag operation, I get the following error:
Looking at the source, it looks like it's coming from parseRoleFromHandlerId, which expects the ID to start with either S for a drag source, or T for a drop target. My component is both, and its ID is "T12", so it's not recognized as a drag source by the test backend.
From the examples, I gathered that this use-case is a supported one, but it would be nice to be able to test it.
The text was updated successfully, but these errors were encountered: