Skip to content
Discussion options

You must be logged in to vote

hi @alexamy,

Immutable is a strict immutable generic type that primarily uses TypeScript's readonly keyword to ensure properties are immutable, and it traverses all deep nested properties.

For stricter immutability, we do not recommend such compatibility.

As a workaround, you could also do it this way:

const f = (element: HTMLElement) => {};

const el: Immutable<HTMLElement> = document.body;

f(el as HTMLElement);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexamy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants