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

Allows for an arbitrary number of props in merge-props #412

Merged
merged 3 commits into from
Dec 31, 2018

Conversation

jimberlage
Copy link
Contributor

We've run into a few instances of people trying to use reagent.core/merge-props like clojure.core/merge, with multiple maps. For an example, think of something like this:

(r/merge-props
  {:style {:display "flex" :flex-direction "flex-column"}}
  (when @loading
    {:disabled true {:style {:background-color "gray"}}})
  (when @demo
    {:class "demo-list"}))

This doesn't change the behavior of merge-props for existing code. (Unless people were relying on having (merge-props {}) throw an error?)

@Deraen
Copy link
Member

Deraen commented Dec 31, 2018

Merged with some tuning (fixed :class collection handling) and I also added class-names utility function.

@Deraen Deraen merged commit d2b974d into reagent-project:master Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants