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

LouisBrunner / dnd-multi-backend / 6261880530

21 Sep 2023 12:49PM CUT coverage: 98.498%. Remained the same
6261880530

Pull #190

github

LouisBrunner
fix(build): issue due to upgrade to esbuild 0.18+
Pull Request #190: fix(build): issue due to upgrade to esbuild 0.18+ (fixes #189)

63 of 67 branches covered (0.0%)

Branch coverage included in aggregate %.

265 of 266 relevant lines covered (99.62%)

37.11 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