cferdinandi / reef

A lightweight library for creating reactive, state-based components and UI.

Home Page:https://reefjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to force a component to "rerender" without adding content?

mouse0270 opened this issue · comments

I use a component and inside this component I format the responding HTML based on a user setting. So that they can customize the look and feel of their app.

The problem is, since this is just changing the function that is being called inside of the component and not the store, the component doesn't update with the new layout until the user does something to change the store or reload their page.

Is there a way to force either the component to rerender or basically trigger the store to update so that component rerenders without actually updating the store? I'd like to make this as smooth as a transition as possible for the user without forcing them to reload.

Duh, I could save the theme into the store, and when I update the theme, that would update the store causing the component to rerender... Duh...

Components also have a render() method that I just noticed isn’t documented. I’ll update the docs soon.