Data-binding with Reagent/React and Google Closure

I can’t give you the full example of how to do that, but the things you are looking for are probably easiest expressed using react hooks. In particular you want useEffect and useRef. The basic setup looks something like that, just replace any pdfjs reference with the closure autocomplete.

If you want to update the autocomplete suggestions, you’ll likely need another useRef to keep the reference to the autocomplete component, and then another useEffect to set the new values.

All in all I would strongly suggest using a react autocomplete. The closure UI stuff doesn’t really fit into the react model, and I doubt many people outside of google use it.

1 Like