Skip to content
Advertisement

How to import ipcRenderer in react?

I’ve tried to import ipcRenderer in react app

JavaScript

but I get this error message : require is not defined

Advertisement

Answer

You need to use

JavaScript

Otherwise it will try to import it from Webpack or whatever module bundler you use.

You can checkout this thread for a better explanation:

https://github.com/electron/electron/issues/7300

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement