• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LouisBrunner / dnd-multi-backend / 5512466585

pending completion
5512466585

Pull #135

github

web-flow
Merge 21f040e86 into b6eb3c04b
Pull Request #135: chore(deps-dev): bump jest-environment-jsdom from 29.5.0 to 29.6.1

63 of 67 branches covered (94.03%)

Branch coverage included in aggregate %.

264 of 265 relevant lines covered (99.62%)

37.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/packages/react-dnd-multi-backend/src/components/DndProvider.tsx
1
import React, {useState, createContext, ReactNode} from 'react'
120✔
2
import { DndProvider as ReactDndProvider } from 'react-dnd'
15✔
3
import { MultiBackend, MultiBackendOptions } from 'dnd-multi-backend'
15✔
4

5
export const PreviewPortalContext = createContext<Element | null>(null)
15✔
6

7
export type DndProviderProps = {
8
  context?: any, // eslint-disable-line @typescript-eslint/no-explicit-any
9
  options: MultiBackendOptions,
10
  children?: ReactNode,
11
  debugMode?: boolean,
12
  portal?: Element,
13
}
14

15
export const DndProvider = ({portal, ...props}: DndProviderProps): JSX.Element => {
15✔
16
  const [previewPortal, setPreviewPortal] = useState<Element | null>(null)
21✔
17

18
  return (
21✔
19
    <PreviewPortalContext.Provider value={portal ?? previewPortal}>
21✔
20
      <ReactDndProvider backend={MultiBackend} {...props} />
21
      {portal ? null : <div ref={setPreviewPortal} />}
21✔
22
    </PreviewPortalContext.Provider>
23
  )
24
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc