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

Behaviour of "use" property in Layer component #10

Open
antonfisher opened this issue Jan 4, 2017 · 1 comment
Open

Behaviour of "use" property in Layer component #10

antonfisher opened this issue Jan 4, 2017 · 1 comment

Comments

@antonfisher
Copy link

antonfisher commented Jan 4, 2017

Hi Alexey,
I have some trouble with use option. My code was:

<Layer id="my-id">
  {() => <MyComponent item={item} />}
</Layer>

But MyComponent did not get changed after update parent's property item from item.children = ['a'] to item.children = ['a', 'b'].

I have fixed that by this code:

<Layer id="my-id" use={item.children}>
  {() => <MyComponent item={item} />}
</Layer>

May be it should be more predictable here.
For example, always return true in shouldComponentUpdate (https://github.com/fckt/react-layer-stack/blob/master/src/components.js#L61) if there is no use parameter defined by user and there is no way to detect children props changes.
What do you think?

@lexfrl
Copy link
Owner

lexfrl commented Jan 10, 2017

good points! I'm on the same 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