reagent 2024-07-19

Hi, how a "data-<name>" attribute should be written?

I'm getting this error:

🙌 1

forget the "=" the error is the same

:data-* works just fine for me. By "the error is the same", do you mean that it still includes = even when you remove it?

no, the error still comes out when the attribute doesn't have the =

And the error then is about :data-bs-toggle, not :data-bs-toggle=, right? Just want to confirm.

If yes, then what's components/input?

yes, the error (warning) is about :data-bs-toggle

the resulting html is something like <button ... dataBsToggle="dropdown">

OK, but what is components/input?

(defn input [{:keys [label error container-size value name id] :as p}]
  (let [input-id (str "input_" (or id name))
        props (dissoc p :label :container-size error)
        class-str ((or container-size :normal) container-classes)
        input-props (merge-props props {:id input-id :value (or value "") :class (when error "is-invalid")})]
    [:div {:class class-str}
     [:label.form-label {:for input-id} label]
     [:input.form-control input-props]
     (when error [:div.invalid-feedback error])]))

And does the overall rendering go through the regular Reagent machinery? What's the version of React and react-dom?

and yes regular reagent

Alright, same here. And the Reagent version?

Also the same. I just tried it to double-check and it ended up as data-bs-toggle="dropdown" in the HTML, without a warning. Just as expected. What's also weird is that you see dataBsToggle in the HTML but the warning is about data-bs-toggle. I don't see how these two facts can be observed together. There can be all sorts of weird behaviors in these scenarios: • The actual Reagent version is different (check what's on the classpath of the CLJS build process) • The actual React version is different (check node_modules/react/package.json) • There are two versions of React loaded by the page

Oh! What's merge-props?

Alright, no clue then apart from the bullet list above. I'll take a look if you create a public MRE.

thanks, we will continue debugging ... I'll ask if it is possible to create something public

🥳 it is working, we cleaned and re-installed with npm and now it is working

there were definitely something wrong with the node modules

thank you very much!

👍 1

Might've been nested node_modules somewhere with an older version of React, or something like that. It's a good idea to report such nested modules in your CI or somewhere else (e.g. shadow-cljs release report produces an output that specifies which modules are included more than once).