Fork me on GitHub
#clojurescript
<
2021-02-28
>
grazfather15:02:39

Does anyone here use roam? it’s written in cljs, and specifically supports adding your own js. I wonder if there’s a way to write extensions in cljs specifically

grazfather16:02:05

Why off topic?

grazfather15:03:49

Awesome. Thanks again. Seems my timing was pretty good

zendevil19:02:58

How to write the following in cljs?:

zendevil19:02:07

new Date(23456789987)

zendevil19:02:28

I tried (Date. 23456789987) but I’m getting the error that “undefined is not a constructor. (evaluating new app.name.Date(23456789987))” How to fix this?

dpsutton19:02:31

Put js/Date. Instead of the Date. You’re using

jsmesami22:02:44

You can also use "new" in CLJS: (new js/Date 23456789987)

hadils22:02:00

Hi! I am trying to use Native Base (React Native) in Clojurescript. Here is my code:

(n/ui-container {}
      (n/ui-content {}
        (n/ui-form {}
          (n/ui-picker
            {:note true
             :mode "dropdown"
             :style {:width 200}
             :selectedValue "1"
             :onValueChange (fn [x y] (log/debug x y  ))}
            (mapv (fn [item]
                    (let [i (str (.-id item))
                          n (str (.-name item))]
                      (n/ui-picker-item
                        {:label n
                         :value i
                         :key   i}))) (into-array [#js{"id" "1" "name" "Foo"} #js{"id" "2" "name" "Bar"}])))
          #_(when (seq categories)
              (ui-category-list (comp/computed categories {:left-picked left-picked :pick-left pick-left})))
          #_(when (seq items)
              (ui-item-list (comp/computed items {:right-picked right-picked :pick-right pick-right}))))))
I get the following error message;
TypeError: undefined is not an object (evaluating 'child.props.value')
I appreciate any help. Thanks!

p-himik22:02:25

Can't say anything definite without a stacktrace, but it seems like some component is expecting a child and isn't getting one.

hadils22:02:53

Here is a shortened stacktrace:

TypeError: undefined is not an object (evaluating 'child.props.value')

This error is located at:
    in PickerNB (at connectStyle.js:392)
    in Styled(PickerNB) (created by yardwerk.mobile-ui.root/JobInput)
    in RCTView (at View.js:34)
    in View (at Form.js:10)
    in Form (at connectStyle.js:392)
    in Styled(Form) (created by yardwerk.mobile-ui.root/JobInput)
    in RCTScrollContentView (at ScrollView.js:1124)
    in RCTScrollView (at ScrollView.js:1260)
    in ScrollView (at ScrollView.js:1286)
    in ScrollView (at KeyboardAwareHOC.js:487)
    in KeyboardAwareScrollView (at Content.js:37)
    in RCTSafeAreaView (at SafeAreaView.js:51)
    in ForwardRef(SafeAreaView) (at Content.js:36)
    in Content (at connectStyle.js:392)
    in Styled(Content) (created by yardwerk.mobile-ui.root/JobInput)
    in RCTView (at View.js:34)
    in View (at Container.js:12)
    in Container (at connectStyle.js:392)
    in Styled(Container) (created by yardwerk.mobile-ui.root/JobInput)
    in yardwerk.mobile-ui.root/JobInput (created by yardwerk.mobile-ui.root/Root)
    in yardwerk.mobile-ui.root/Root
    in Unknown (created by ExpoRoot)
    in ExpoRoot (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in DevAppContainer (at AppContainer.js:121)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)

p-himik23:02:24

I don't see any of the components above being mentioned in the trace, so there's still too little information for me to tell anything useful.

p-himik23:02:35

And where is NBPicker in your code snippet above? If you know, then you already know more than I do. :)

hadils23:02:54

Ok. Thanks for your help @U2FRKM4TW