({
nodeName = "div",
onRefPassThrough,
...rest
}: SwipeableProps & {
nodeName?: string;
onRefPassThrough?(el: HTMLElement): void;
})
| 32 | * Wrapping component for the hook testing |
| 33 | */ |
| 34 | function SwipeableUsingHook({ |
| 35 | nodeName = "div", |
| 36 | onRefPassThrough, |
| 37 | ...rest |
| 38 | }: SwipeableProps & { |
| 39 | nodeName?: string; |
| 40 | onRefPassThrough?(el: HTMLElement): void; |
| 41 | }) { |
| 42 | const eventHandlers = useSwipeable(rest); |
| 43 | const Elem = nodeName as React.ElementType; |
| 44 | |
| 45 | const refPassthrough = (el: HTMLElement) => { |
| 46 | onRefPassThrough?.(el); |
| 47 | |
| 48 | // call useSwipeable ref prop with el |
| 49 | eventHandlers.ref(el); |
| 50 | }; |
| 51 | |
| 52 | return ( |
| 53 | <Elem {...eventHandlers} ref={refPassthrough}> |
| 54 | <span>{TESTING_TEXT}</span> |
| 55 | </Elem> |
| 56 | ); |
| 57 | } |
| 58 | |
| 59 | const MD = "mouseDown"; |
| 60 | const MM = "mouseMove"; |
nothing calls this directly
no test coverage detected
searching dependent graphs…