Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Props with numbers in are dropped or truncated #32

Closed
danielneal opened this issue Mar 7, 2019 · 1 comment
Closed

Props with numbers in are dropped or truncated #32

danielneal opened this issue Mar 7, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@danielneal
Copy link
Contributor

danielneal commented Mar 7, 2019

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

(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.

I think this is because of the implementation of camel->kebab.

@lilactown
Copy link
Collaborator

lilactown commented Mar 8, 2019

Nice find! Fixed with 3afd7d4

@lilactown lilactown added the bug Something isn't working label Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants