clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
grazfather 2021-02-28T15:01:39.118400Z

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

grazfather 2021-03-01T15:32:49.137100Z

Awesome. Thanks again. Seems my timing was pretty good

grazfather 2021-02-28T16:54:05.119700Z

Why off topic?

zendevil 2021-02-28T19:33:58.120300Z

How to write the following in cljs?:

zendevil 2021-02-28T19:34:07.120500Z

new Date(23456789987)

zendevil 2021-02-28T19:35:28.122100Z

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?

dpsutton 2021-02-28T19:38:31.122800Z

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

zendevil 2021-02-28T19:43:17.123100Z

thanks @dpsutton

jsmesami 2021-02-28T22:45:44.126500Z

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

hadils 2021-02-28T22:51:00.127900Z

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-himik 2021-02-28T22:55:25.128Z

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

hadils 2021-02-28T22:58:53.128300Z

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-himik 2021-02-28T23:03:24.128500Z

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.

hadils 2021-02-28T23:06:23.128700Z

NBPicker

p-himik 2021-02-28T23:08:35.128900Z

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

hadils 2021-02-28T23:13:54.129100Z

Ok. Thanks for your help @p-himik