Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addStyle and removeStyle expect 1 argument less than they should #8

Closed
devicarus opened this issue Feb 3, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@devicarus
Copy link

Hi, I'm having an issue with the DOM.addStyle and DOM.removeStyle methods, for some reason they expect 1 argument less than they should?

src/index.tsx:15:37 - error TS2554: Expected 1 arguments, but got 2.
15     this.bdApi.DOM.addStyle('test', `random css`);
                                       ~~~~~~~~~~~~

src/index.tsx:20:32 - error TS2554: Expected 0 arguments, but got 1.
20     this.bdApi.DOM.removeStyle('test');
@Zerthox Zerthox added the bug Something isn't working label Feb 19, 2024
@Zerthox
Copy link
Owner

Zerthox commented Feb 19, 2024

This is intended, because id is bound to the caller name passed in new BdApi. However, it seems that contrary to other APIs that get bound to the caller name addStyle and removeStyle support passing a custom id to override the set caller name.

@Zerthox
Copy link
Owner

Zerthox commented Feb 19, 2024

Fixed in 239c1c1.

@Zerthox Zerthox closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants