Closed Chandan-TY closed 1 year ago
@nashaofu Could you please guide me on fixing the above issue
Do you have a recurrence code? Do you want to use the electric screenshot? Can the following code work normally?
import { app, globalShortcut } from 'electron'
import Screenshots from './screenshots'
app.whenReady().then(() => {
const screenshots = new Screenshots()
globalShortcut.register('ctrl+shift+a', () => {
screenshots.startCapture()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
The issue is resolved after adding alias: { react: path.resolve('./node_modules/react'), } inside resolve object in webpack.config.js. Anyway thanks for your quick response.
We are using React version 18.1.0 along with the electron app. While we tried installing electron-screenshots and using them. We are getting an Invalid hook call. You might have mismatching versions of React and the renderer. I can see in node_modules\electron-screenshots\node_modules\react-screenshots the react version is 17.0.2. I think the issue is because of that. Let us know what is the fix for this issue.
Steps to reproduce the behavior:
Expected behavior Should support React version 18 also
Versions: