Fork me on GitHub
#re-frame
<
2020-02-11
>
Wilson Velez20:02:58

hi, I’m using Highcharts-react-official https://github.com/highcharts/highcharts-react in a re-frame app, someone knows how can I get the chart instance in order to call the showloading() method? thanks

superstructor22:02:20

Using reagent/create-class and reagent-render you can probably do something like

(defn highcharts
   [& {:keys [my kw args}]
   (let [js-highcharts (atom nil)]
      (r/create-class
        {:display-name "highcharts"
         :reagent-render
           (fn [& {:keys [my kw args]}]
               [:> hightcharts-react
                   {:ref (fn [instance]
                           (when instance
                               (reset! js-hightcharts instance)) ....