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

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

Closed
mouse0270 opened this issue Oct 29, 2022 · 3 comments
Closed

Comments

@mouse0270
Copy link

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.

@mouse0270
Copy link
Author

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

@cferdinandi
Copy link
Owner

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

@cferdinandi cferdinandi reopened this Oct 29, 2022
@cferdinandi
Copy link
Owner

Updated the docs: https://reefjs.com/api/#component

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