This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-03
Channels
- # announcements (21)
- # aws (6)
- # babashka (28)
- # beginners (39)
- # biff (1)
- # calva (23)
- # cider (5)
- # clj-kondo (108)
- # clojure (11)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-nlp (10)
- # clojure-uk (8)
- # clojurescript (29)
- # community-development (4)
- # conjure (20)
- # css (3)
- # datalevin (9)
- # datomic (3)
- # events (2)
- # figwheel-main (11)
- # fulcro (36)
- # honeysql (7)
- # humbleui (5)
- # interceptors (4)
- # introduce-yourself (3)
- # jobs (1)
- # lsp (51)
- # malli (1)
- # meander (71)
- # minecraft (8)
- # other-languages (18)
- # pathom (15)
- # polylith (25)
- # portal (10)
- # re-frame (5)
- # reitit (15)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (11)
- # tools-deps (27)
Question on npm package import. Specifically for this package: https://www.npmjs.com/package/react-deep-force-update. I imported it with:
(ns app.util.dev
(:require
[reagent.core :as r]
["react-deep-force-update" :as deep]
,,,))
I checked the js-keys in deep
, but found nothing. How could this happen?@i why do you expected keys? maybe you just do (deep)
? maybe deep
is just a function? or maybe see the usage examples here https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
in theory yes. but the package may not be published as actual esm. in which case it might not have default export
but for those kinds of packages often react-deep-force-update$default
and react-deep-force-update
yield the same thing
It is: https://github.com/gaearon/react-deep-force-update/blob/843afa2c7fcc820c079144c3948bed2784b36f12/src/index.js#L56.
My fundamental question is how to invoke the deepForceUpdate function.
react-deep-force-update$default
gives a nil.
don't ever look at the source of a npm package to make guess how about how it is actually published
my guess is as I said (:require ["react-deep-force-update" :as deep])
and then just (deep)
somewhere
this is the content of the actual npm package https://unpkg.com/[email protected]/lib/index.js