Fork me on GitHub
#re-frame
<
2020-02-29
>
Ramon Rios18:02:19

Hello friends, my view is compiled but not showing anything at all when i create my-view function.

(ns my-app.views
  (:require
   [re-frame.core :as re-frame]
   [re-com.core :as re-com]
   [my-app.subs :as subs]
   ))

(defn title []
  (let [name (re-frame/subscribe [::subs/name])]
    [re-com/title
     :label (str "Hello from " @name)
     :level :level1]))


(defn my-panel
  []
   [re-com/input-text
    :width "300px"
    :placeholder "input your string here"])

(defn main-panel []
  [re-com/v-box
   :height "100%"
   :children [[title]
              [my-panel]]])
Am i missing something??

p-himik18:02:32

Will you at least provide the code for the my-view function?

Ramon Rios18:02:43

Sorry, the view is my-panel. I made a mistake with the name

Ramon Rios18:02:06

And sorry for the pin, it was untencional

p-himik18:02:25

Open the JS console. You will see a few errors there with a well specified reason.

Ramon Rios18:02:14

Ok, i forgot that. Thank you

dpsutton18:02:57

Your panel doesn’t include any information where the value should go. So title knows to show the name sub but it’s not clear that you’ve hooked up the input to put its value there

p-himik18:02:55

Why do you think the title's value is linked to the my-panel input?

dpsutton18:02:21

I assumed this was a little demo. But the point remains that the input text component doesn’t have a value it’s using

p-himik18:02:27

It doesn't have :model and it doesn't have :on-change. And, as I mentioned, both of these issues will be specified in the JS console. :) Because re-com checks every argument of its components.

👍 8