0

I'm trying to add a menu to my Electron+React project, but all of the documentation/tutorials seem incomplete. For example, the official docs describe adding a menu from a template in electron.js, but don't say how to actually connect that to any behavior in your app. In particular, I need undo/redo to modify the application's state. If you follow that tutorial, you get a menu with a bunch of options that don't do anything.

If I try to create a menu within my application code, I get errors about the fs module. Even just trying to import { Menu } from 'electron' gives me:

TypeError: fs.existsSync is not a function

Googling that error gives me this SO thread with a solution involving webpack, but I'm not using webpack.

What do I do?

MattPutnam
  • 2,927
  • 2
  • 17
  • 23

0 Answers0