Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Changing parent UI affects children #26

Open
Arjeno opened this issue Apr 1, 2016 · 4 comments
Open

Changing parent UI affects children #26

Arjeno opened this issue Apr 1, 2016 · 4 comments

Comments

@Arjeno
Copy link

Arjeno commented Apr 1, 2016

We have this basic setup:

  • Parent with UI
    • Child with UI
    • Child with UI

Each time the parent UI changes it will update the children UI as well, forcing an update. We want to keep the children pure, we do not need the parent UI settings.

I understand this can be handy in some cases, in some cases it may not be handy and will require a manual check in shouldComponentUpdate to see if the internal UI settings were updated. Is there any way to make this configurable? Just wondering what you guys think about this.

@tonyhb
Copy link
Owner

tonyhb commented Apr 4, 2016

Good question. I think you're right that it could be configurable, and default to sharing state from parent -> child.

The idea of parent-level block scoping is useful when you build reusable components like pagination, which affects the parent set that loads data. The parent component might set the page UI state and the pagination component could modify it.

I'll add this to the 1.0 roadmap to make it an option.

Thanks @Arjeno

@Arjeno
Copy link
Author

Arjeno commented Apr 6, 2016

Thanks for the response @tonyhb. I didn't realize UI props were also settable from child to parent when they are shared like that. Thanks for considering making it an option!

@jshthornton
Copy link

I'd love this feature too.

Say I have a scene where I want a child component's ui to be different than another scene's child component's ui. You could pass down props, but then you have some information in props and some in state, which gets real messy real quick.

@tonyhb
Copy link
Owner

tonyhb commented May 3, 2016

+1 thanks for the heads up @jshthornton. Work at Docker has been exceptionally busy pushing out a new version of our platform, getting back onto this now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants