Browse Source

docs: fix broken code in drag and drop example (#45332)

Niklas Wenzel 2 months ago
parent
commit
5c67cd9150
1 changed files with 1 additions and 4 deletions
  1. 1 4
      docs/tutorial/native-file-drag-drop.md

+ 1 - 4
docs/tutorial/native-file-drag-drop.md

@@ -22,12 +22,9 @@ In `preload.js` use the [`contextBridge`][] to inject a method `window.electron.
 
 ```js
 const { contextBridge, ipcRenderer } = require('electron')
-const path = require('node:path')
 
 contextBridge.exposeInMainWorld('electron', {
-  startDrag: (fileName) => {
-    ipcRenderer.send('ondragstart', path.join(process.cwd(), fileName))
-  }
+  startDrag: (fileName) => ipcRenderer.send('ondragstart', fileName)
 })
 ```