Binding xterm-for-react in jsoo/react?

    // Import XTerm
    import { XTerm } from 'xterm-for-react'

    // Render the component
    <XTerm options={{ lineHeight: 3 }} />

My question here is not how to npm i xterm-for-react or how to bundle it via esbuild – I can do both of those. My question here is: how do I bind/wrap this so I an use it from jsoo-react ?

In particular <Xterm...> is a JS React component I want to be able to use from jsoo-react, and I’d like to be able to pass data to it / pass it callbacks (ocaml/jsoo functions that gets called on events).

Thanks!

1 Like

I have skimmed How to bind a JS library for OCaml a few times; I still don’t think I fully understand it. One thing I definitely do not understand is: how do I convert the following line from js/ts to ocaml/jsoo:

import { Terminal, I%TerminalOptions, ITerminalAddon } from 'xterm'

the issue that I don’t understand how to do is the import/from – the examples on the FFI binding page seems to be about binding globals, whereas here we want to do an import/from

Thanks!