cljs Om interop with React components?

Victor Marchuk

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?

Martin Klepsch

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related