vscode
vscode copied to clipboard
react project -> create new playground -> use is seen as a react hook and throws error
Bug Report
Current Behavior
create new playground uses the method 'use' which in a react project throws an error as use can only be used inside of a react hook
unable to start playground
Code/Gist
use(yourDb);
Expected Behavior/Code
don't use the function keyword 'use'
Environment
Version: 1.97.2 Commit: e54c774e0add60467559eb0d1e229c6452cf8447 Date: 2025-02-12T23:20:35.343Z Electron: 32.2.7 ElectronBuildId: 10982180 Chromium: 128.0.6613.186 Node.js: 20.18.1 V8: 12.8.374.38-electron.0 OS: Linux x64 6.12.13-200.fc41.x86_64
Possible Solution
to fix github co-pilot solved for me by replacing use with db.getSiblingDB(yourDB)
Additional Context/Screenshots
Is this an error reported by eslint or another linter? If so, this is specific to your workplace configuration and can be fixed by adding the file as an exception in your linter configuration.