Victor Marchuk
Victor Marchuk

Reputation: 13886

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?

Upvotes: 5

Views: 873

Answers (1)

Martin Klepsch
Martin Klepsch

Reputation: 1915

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/)

Upvotes: 8

Related Questions