Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cljs Om interop with React components?

Is it possible to use third-party React components in an Om application?

I have a project written in ClojureScript with Om and I would like to use JedWatson/react-select, how should I approach this problem?

like image 938
Victor Marchuk Avatar asked Aug 21 '15 06:08

Victor Marchuk


1 Answers

There are a few steps to this:

  • Packaging the JS library for use in Clojurescript JS libaries are packages as foreign-libraries you can read more about this in the ClojureScript wiki.
  • after you required your foreign lib you can access it though the global namespace (js/) and call functions defined by your library.

Here is an example of using fixed-data-table with Om.

The packaged foreign library for it can be found in the CLJSJS packages repository. (More information about CLJSJS can be found on the website: http://cljsjs.github.io/)

like image 102
Martin Klepsch Avatar answered Oct 01 '22 07:10

Martin Klepsch