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

As of 0.12.0 some mixins don't function as docs suggest #221

Closed
mahsa2 opened this issue Jul 7, 2020 · 4 comments
Closed

As of 0.12.0 some mixins don't function as docs suggest #221

mahsa2 opened this issue Jul 7, 2020 · 4 comments

Comments

@mahsa2
Copy link

mahsa2 commented Jul 7, 2020

I updated rum from 0.11.4 to 0.12.2 and some mixins don't function as docs suggest.

  1. Using rum/static with rum/local doesn't rerender the component when the value of rum/local is updated.

  2. Using both of rum/reactive and rum/static in defc causes incorrect behaviour.
    Steps to reproduce: Set items as follows and have a button to change the value of items with each click.

(when-let [{:keys [items]}  (rum/react (citrus/subscription reconciler [:blah])
	(println items)

I expect items to change the value on each click but the value is updated to the value of the click before the most recent one.
Note: I use [clj-commons/citrus "3.2.3" :exclusions [rum]] which can be related to #215

If this is expected behaviour, could you please clarify the documentation?

I worked around the two issues above by removing the rum/static but this impacts performance. Thank you in advance :)

@roman01la
Copy link
Collaborator

Cold you please first try to identify in which version of Rum exactly this behavior changed? There was a couple of releases after 0.11.4. Once you found that version, please try to repro the issue w/o citrus. Post your findings here, thank you.

@mahsa2 mahsa2 changed the title As of 0.12.2 some mixins don't function as docs suggest As of 0.12.0 some mixins don't function as docs suggest Jul 7, 2020
@mahsa2
Copy link
Author

mahsa2 commented Jul 7, 2020

Both issues started in 0.12.0

I made the following example to test the second issue:

(def *count (atom 0))

(rum/defc Layout
  < rum/reactive
    rum/static
  []
  [:div {:on-click #(swap! *count inc)}
    "Clicks: " (rum/react *count)])

In the above example, the atom updates but the component doesn't show it. By mounting the component again, the atom's value is equal to the total number of clicks we expected.

@roman01la
Copy link
Collaborator

fixed in 0.12.3

@mahsa2
Copy link
Author

mahsa2 commented Jul 8, 2020

Awesome, thank you very much. That was quick :)

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

No branches or pull requests

2 participants