Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

[Feature] Make Feature Toggle handle dynamic rendering condition #833

Open
rohithbalaji123 opened this issue Jun 4, 2020 · 0 comments
Open
Labels
design-doc Write a design doc for a feature enhancement New feature or request

Comments

@rohithbalaji123
Copy link
Member

What is the problem?
Currently, for the components dependent on feature toggle, decision to render is made when it is mounted and remains in the state until the page refreshes or it's parent component remounts. Our application being a single page app, there are cases where the components rendering status should change dynamically without refreshing the page.

Your solution
We should ideate on how we can remount the components in focus when the feature toggle changes and reflect the change in the UI immediately.

Alternatives considered
For now, we are using react states to maintain the rendering condition for each component and setting and un-setting it whenever we expect the state is supposed to change.

Additional context
Here is an example for this scenario. Assume there be an admin button in home page which is rendered for only admin users to navigate to admin panel. This is shown when the user logs in and the user has permission to view the button. Now, when the users logs out, the login modal pops up while still displaying the admin button in the background although the user no longer has permission to see it. This happens as the button component is not remounted. For the time being, we are maintaining a state which is unset when user logs out and thus not render the button.

@rohithbalaji123 rohithbalaji123 added enhancement New feature or request design-doc Write a design doc for a feature labels Jun 4, 2020
@rohithbalaji123 rohithbalaji123 changed the title [Feature] Feature Toggle for dynamic decision making [Feature] Make Feature Toggle handle dynamic rendering condition Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design-doc Write a design doc for a feature enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant