Fork me on GitHub
#shadow-cljs
<
2021-07-26
>
zendevil.eth07:07:49

and I have [react-modern-calendar-datepicker *:as* DatePicker] in require

zendevil.eth07:07:43

(using reagent) and tried using like [:> DatePicker] and [DatePicker] but getting error:

zendevil.eth07:07:46

react-dom.development.js:68 Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

zendevil.eth07:07:18

and template.cljs:277 Uncaught Error: Assert failed: Invalid Hiccup form: [#js {:Calendar #object[F], :default #object[global], :utils #object[T]}] (in humboi.core.raise_page) respectively

zendevil.eth07:07:56

How to use DatePicker?

alexdavis08:07:27

Use this table to work out what your require should look like https://shadow-cljs.github.io/docs/UsersGuide.html#js-deps

zendevil.eth09:07:16

Thank you. This worked with :default

zendevil.eth09:07:40

However, when I use this import 'react-modern-calendar-datepicker/lib/DatePicker.css'; like ["react-modern-calendar-datepicker/lib/DatePicker.css"] I get:

Failed to inspect file
  /Users/prikshetsharma/Desktop/humboi/node_modules/react-modern-calendar-datepicker/lib/DatePicker.css

it was required from
  /Users/prikshetsharma/Desktop/humboi/src/cljs/humboi/core.cljs

Errors encountered while trying to parse file
  /Users/prikshetsharma/Desktop/humboi/node_modules/react-modern-calendar-datepicker/lib/DatePicker.css
  {:line 1, :column 1, :message "primary expression expected"}

jaju09:07:11

I don’t think you can import/require a css file.

thheller09:07:40

css is not supported

romdoq14:07:40

Is the :node-library target suitable for code that will be executed in the browser, rather than by node? Are there particular circumstances or edge cases to be aware of?

thheller15:07:35

it is meant for node so watch and compile won't run in the browser. release only when processed by webpack or so