Closed danielneal closed 5 years ago
Props that contain numbers that get passed to components defined with defnc end up going missing or having the numbers truncated.
defnc
For example - the test component below never receives a value for :x1, and receives a value for :test rather than :test2
:x1
:test
:test2
(defnc Test [opts] (println opts) [:div]) [Test {:x1 0 :test2 1}] => {: 0 :test 1 :class nil}
You can also see this if you call (hx.react/props->clj #js {"x0" 1}) directly.
(hx.react/props->clj #js {"x0" 1})
I think this is because of the implementation of camel->kebab.
camel->kebab
Nice find! Fixed with https://github.com/Lokeh/hx/commit/3afd7d4c1fb0815006954554dc4ebdd6d80b14b0
Props that contain numbers that get passed to components defined with
defnc
end up going missing or having the numbers truncated.For example - the test component below never receives a value for
:x1
, and receives a value for:test
rather than:test2
You can also see this if you call
(hx.react/props->clj #js {"x0" 1})
directly.I think this is because of the implementation of
camel->kebab
.