title: Import react-table into ClojureScript with Shadow-CLJS
body: <p>Web development newbie here. I'm trying to use the NPM react-table package with a ClojureScript/Reagent project. I'm failing to import the package properly. What I've done:</p>
  
  <p>1/installed react-table through NPM, it's in my project directory</p>
  
  <p>2/in my main namespace, I've included <code>(:require ["react-table" :as rt])</code></p>
  
  <p>In the REPL I can see it's making some connection as just typing <code>rt</code> will return <code>#js {:ReactTableDefaults #js {:data #js [], ...</code></p>
  
  <p>How can I actually create a table? I've tried things such as </p>
  
  <p><code>rt/ReactTable {:data [{:a 1 :b 2} {:a 3 :b 4} {:a 6 :b 8}] :columns [{:Header "a" :accessor "a"} {:Header "b" :accessor "b"}]}</code> but I keep hitting into <code>TypeError: module$node_modules$react_table$lib$index.ReactTable is not a function
  </code></p>
  
  <p>I've also read <a href="https://code.thheller.com/blog/shadow-cljs/2017/11/10/js-dependencies-in-practice.html" rel="nofollow noreferrer">https://code.thheller.com/blog/shadow-cljs/2017/11/10/js-dependencies-in-practice.html</a> but that didn't help me enough.</p>
  
  <p><strong>Update</strong> - using figwheel I'm getting somewhere, and this is what I'd like to reproduce in shadow-cljs:</p>
  
  <p>In project.clj: <code>[cljsjs/react-table "6.8.6-0"]</code></p>
  
  <p>In the "view" namespace: <code>(:require [cljsjs.react-table] [reagent.core :as r])</code></p>
  
  <p>Then this actually displays a table:</p>
  
  <pre><code>(def ReactTable (r/adapt-react-class (aget js/ReactTable "default")))
  (defn test-table []
    [:div {:style {:width 320}}
    [ReactTable {:data    [{:a 1 :b 2} {:a 3 :b 6} {:a 6 :b 8}]
                 :columns [
                       {:Header "a" :accessor "a" :width 200}
                       {:Header "b" :accessor "b" :width 100}]
             :showPagination false
             :defaultPageSize 3}]])
  
  (defn main-panel []
    [test-table])
  </code></pre>
  
  <p>Thanks!</p>