Why this jsx not work

I have jsx in which:

const DOC_TYPE = "$escapetool.javascript($doc.getObject('OnlyOffice.Code.OnlyOfficeClass').getProperty('docType').value)

I want to pass xobject’s property to js, but it didn’t work.

what wrong with my code ?

Hi,

have you enabled content parsing of your JSX?

image

thanks for help.
yes parsing enabled, I already got a solution.
as someone in the chat room told me passing data to javascript via parsing is not good, it will disable cache. So I output to html as elment’s data attribute, then get it in javascript.

can you share your solution? I’m interested in a similar use case of data passing to a JS library.