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

Remounting of ReflexElement children when collapsing panes #148

Closed
adri1wald opened this issue Sep 29, 2021 · 1 comment
Closed

Remounting of ReflexElement children when collapsing panes #148

adri1wald opened this issue Sep 29, 2021 · 1 comment

Comments

@adri1wald
Copy link

adri1wald commented Sep 29, 2021

Hi, loving react-reflex, but I found a bug which prevents us from using it. Unless we can find a solution :D

I took the example from react-reflex collapse demo and tried to adapt it for our app.

However, I noticed that components rendered in non-collapsed ReflexElements were remounting on collapse, causing loss of state.

I made a minimum reproduction which shows that the ReflexElement child is being remounted on collapse. If you collapse one of the panes, you will see mounted logged to the console.

@leefsmp
Copy link
Owner

leefsmp commented Oct 1, 2021

I just passed a key on the middle ReflexElement and it seems to solve the problem:

<ReflexElement key="middle-pane" minSize={100} className="middle-pane">
    <LogMount />
</ReflexElement>

@leefsmp leefsmp closed this as completed Oct 1, 2021
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