reactjs - Custom-Electron-Titlebar removeMenuBar typescript issue - Stack Overflow

I'm having an issue with with react and typescript while building an electron app. I'm trying

I'm having an issue with with react and typescript while building an electron app. I'm trying to set up custom-electron-titlebar with my app. For the most part its working fine. However, i have run into webstorm telling me...

TS2353: Object literal may only specify known properties, and removeMenuBar does not exist in type TitleBarOption

When i look at the code sure enough there is no "removeMenuBar" on the interface. I assume this was removed for some reason or another but the docs was never updated. Can someone help explain to me how i can remove the menu bar from the titlebar? I have searched and searched and come up empty handed.

import { Titlebar, TitlebarColor } from "custom-electron-titlebar";

window.addEventListener("DOMContentLoaded", () => {
    new Titlebar({
        backgroundColor: TitlebarColor.fromHex("#000000"),
        titleHorizontalAlignment: "center",
        menuTransparency: 100,
        removeMenuBar: true,
    });
});

I'm having an issue with with react and typescript while building an electron app. I'm trying to set up custom-electron-titlebar with my app. For the most part its working fine. However, i have run into webstorm telling me...

TS2353: Object literal may only specify known properties, and removeMenuBar does not exist in type TitleBarOption

When i look at the code sure enough there is no "removeMenuBar" on the interface. I assume this was removed for some reason or another but the docs was never updated. Can someone help explain to me how i can remove the menu bar from the titlebar? I have searched and searched and come up empty handed.

import { Titlebar, TitlebarColor } from "custom-electron-titlebar";

window.addEventListener("DOMContentLoaded", () => {
    new Titlebar({
        backgroundColor: TitlebarColor.fromHex("#000000"),
        titleHorizontalAlignment: "center",
        menuTransparency: 100,
        removeMenuBar: true,
    });
});
Share Improve this question edited Mar 28 at 13:04 jam j 6241 gold badge2 silver badges19 bronze badges asked Mar 23 at 4:58 Chris WilliamsonChris Williamson 812 silver badges9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The library custom-electron-titlebar is archived, meaning it's not longer maintained. The README is up to date, but not the latest version of the library published on npm. The latter was published on Jan 15 2024, while the functionality you want (added via this PR) has been merged on May 11 2024.

If you still want to use this library anyway, you need to install it from github directly:

npm install "https://github/AlexTorresDev/custom-electron-titlebar.git#main" --save

More details on this question.

Note that because the library uses pnpm, if you use Yarn Berry, then you won't be able to do that because of this issue (or this one).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744296901a4567305.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信