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

How to handle global state? #14

Open
lijunle opened this issue Dec 7, 2017 · 1 comment
Open

How to handle global state? #14

lijunle opened this issue Dec 7, 2017 · 1 comment

Comments

@lijunle
Copy link

lijunle commented Dec 7, 2017

I have a page, it can go to view mode or edit mode. Each components inside the page may look a little bit different in two modes.

What is the best practices to pass in the view/edit mode information to each components? Global is easy but it is leaking the information.

@glauberramos
Copy link

glauberramos commented Dec 8, 2017

I think the best approach is to handle the edit style inside each component. Each component should have a class .component-name and the editing style .component-name-editing. Something like that.

If you don't want to handle inside each component, maybe your page could have a higher class like .page-name and .page-name-editing and from that you can change the style of each component. But that is not the best because you can't reuse the styles if you use the same component on another page.

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