reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
mmeix 2020-03-19T17:14:13.170600Z

Hello! I’m just trying to use smooth-ui in a reagent project. I have this in my package.json:

"dependencies": {
    "@smooth-ui/core-sc": "11.1.5",
    "create-react-class": "^15.6.3",
    "highlight.js": "9.15.10",
    "react": "^16.13.0",
    "react-dom": "^16.13.0",
    "styled-components": "^4.1.2",
    "reakit": "^1.0.0-beta.12",
    "styled-icons": "^5.4.0" 
  }

mmeix 2020-03-19T17:15:34.171100Z

and in my src-file:

p-himik 2020-03-19T17:15:42.171400Z

Triple backticks for multiline codeblocks.

mmeix 2020-03-19T17:15:42.171600Z

(ns app.views
  (:require [app.state :refer [app-state]]
            [app.mei :as m]
            [reagent.core :as r]
            ["@smooth-ui/core-sc" :refer [Normalize Button]]))

mmeix 2020-03-19T17:15:57.171700Z

ok sorry

p-himik 2020-03-19T17:17:26.172600Z

And a new line after the opening triplet, plus a new line in front of the closing one. :)

mmeix 2020-03-19T17:18:43.172800Z

argh

mmeix 2020-03-19T17:21:01.173300Z

hopefully …

👍 1
mmeix 2020-03-19T17:21:24.173600Z

Error:

mmeix 2020-03-19T17:21:46.174Z

Uncaught TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at getTheme (smooth-ui-core-sc.cjs.js:106)
    at eval (smooth-ui-core-sc.cjs.js:131)
    at renderWithHooks (react-dom.development.js:14826)
    at updateForwardRef (react-dom.development.js:16841)
    at beginWork (react-dom.development.js:18679)
    at HTMLUnknownElement.callCallback (react-dom.development.js:189)
    at Object.invokeGuardedCallbackImpl (react-dom.development.js:238)
    at invokeGuardedCallback (react-dom.development.js:293)
    at beginWork$1 (react-dom.development.js:23235)
getTheme @ smooth-ui-core-sc.cjs.js:106
eval @ smooth-ui-core-sc.cjs.js:131
renderWithHooks @ react-dom.development.js:14826
updateForwardRef @ react-dom.development.js:16841
beginWork @ react-dom.development.js:18679
callCallback @ react-dom.development.js:189
invokeGuardedCallbackImpl @ react-dom.development.js:238
invokeGuardedCallback @ react-dom.development.js:293
beginWork$1 @ react-dom.development.js:23235
performUnitOfWork @ react-dom.development.js:22189
workLoopSync @ react-dom.development.js:22162
performSyncWorkOnRoot @ react-dom.development.js:21788
scheduleWork @ react-dom.development.js:21220
updateContainer @ react-dom.development.js:24408
eval @ react-dom.development.js:24793
unbatchedUpdates @ react-dom.development.js:21935
legacyRenderSubtreeIntoContainer @ react-dom.development.js:24792
exports.render @ react-dom.development.js:24875
reagent$dom$render_comp @ dom.cljs:17
eval @ dom.cljs:41
eval @ dom.cljs:36
app$core$start @ core.cljs:9
app$core$main @ core.cljs:13
window.onload @ (index):27
load (async)
(anonymous) @ (index):27
react-dom.development.js:19561 The above error occurred in the <Button> component:
    in Button (created by Context.Consumer)
    in StyledComponent (created by styled(Button))
    in styled(Button) (created by <http://app.views.app|app.views.app>)
    in <http://app.views.app|app.views.app>

mmeix 2020-03-19T17:21:59.174300Z

What am I doing wrong?

p-himik 2020-03-19T17:22:57.174600Z

But what's the code though?

mmeix 2020-03-19T17:23:23.174800Z

(forgot while reformatting post, sorry)

mmeix 2020-03-19T17:23:37.175100Z

(defn app []
  [:&lt;&gt;
   [:&gt; Normalize]
   [:&gt; Button "TEST"]])

mmeix 2020-03-19T17:25:16.175700Z

(and of course:)

mmeix 2020-03-19T17:25:29.175900Z

(defn ^:dev/after-load start
  []
  (rd/render [views/app]
             (.getElementById js/document "app")))

mmeix 2020-03-19T17:25:48.176300Z

(rd … reagent.dom)

lilactown 2020-03-19T17:28:25.177100Z

@mmeix I looked at the current open issues in smooth-ui’s github repo, and found this: https://github.com/smooth-code/smooth-ui/issues/167 it seems very related

mmeix 2020-03-19T17:28:41.177600Z

oh … ok …

mmeix 2020-03-19T17:31:50.178500Z

Learned: look into issues on github before asking here