Thanks for the question.
It looks like you’re using
this in a global context, which in the browser is equivalent to the global
window variable. You can access that in ClojureScript with
If you do need to access
this in any context (including the global context), you can use the
this-as macro. It lets you bind a new local with the current value of
this in the context you’re in.
For example, to do the first two lines of your example:
(set! (.-disabled this) true)
(set! (.-items this) (.-items opts)))
The nice thing about the
this gets rebound so much it’s hard to keep track. In ClojureScript you name it, so you can avoid unnecessary rebindings.