Fork me on GitHub
#reagent
<
2021-06-14
>
Evan Z19:06:24

Hey folks — I’m running into problems using react-plotly.js from reagent

(ns fridgemon.core
    (:require
      [reagent.core :as r]
      [reagent.dom :as d]
      ["react-plotly.js" :as rp]))

;; -------------------------
;; Views


(defn home-page []
  [:div
   [:> rp {} {}]])
yields the following message in chrome’s dev console
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Evan Z19:06:45

Ah sorry folks, import was goofed. Should have been

["react-plotly.js" :default rp]))