ian.shaun.thomas
10/17/2024, 4:18 PMCountingScreen
from Body
the key press handler and click handler both work as expected.
Is this a failure on my part to understand how compose works?
https://github.com/ToxicBakery/compose-html-keydown-issue/blob/main/src/main/kotlin/main.ktian.shaun.thomas
10/17/2024, 4:19 PMAlex Styl
10/17/2024, 5:08 PMDisposableEffect()
and un-register on its onDispose {}.ian.shaun.thomas
10/17/2024, 5:13 PMref
works. ref
is called back when the HTML element is created and the dispose callback is when it is removed from the DOM. Again I could be mistaken but I'll try using DisposableEffect to see if the behavior changes.ian.shaun.thomas
10/17/2024, 9:45 PMref
comment, just for your knowledge. It's my understanding that ref
is effectively a DisposableEffect with the special feature of giving you the created HTML element as its input enabling you to manipulate it directly in some of the edge cases that compose html doesn't support or to have a good hook point to interact with external JS.ian.shaun.thomas
10/17/2024, 9:48 PM