-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
(react-split): How to handle conditional children #744
Comments
This might be related to the issue I'm having #745. Did you find a solution to this in the end? |
I spent a bit of time going into the lib and trying to force it to re-trigger a render. I think if I spent some time actually debugging the code it could be figured out, but for the time being I essentially did my second example. Don't do conditionals within the Split, but conditionally render the entire Split, with all of its children present. |
@adam-binks So, I don't think that this is supported out of the box, but I don't think it's a bad idea. I'll see if I can't get a PR open this week to handle both of our cases. |
Great ok! I spent a couple of hours on this afternoon and I think I tracked
down the part to change - not at my computer at the moment but tomorrow
I'll share my work so far. I'm optimistic that this will be a small change!
|
At first glance that looks a lot like what I had in mind, I wasn't sure if we needed to call I'll see if I can't find that proptype issue! |
Thanks! |
I'm encounter similar issue. `react_devtools_backend.js:4026 The above error occurred in the component:
Consider adding an error boundary to your tree to customize error handling behavior. There is probabably problem, that Split parent component operates with new sizes array over previous element settings and can't find new split elements added as children. |
@martinsvb I've hit the same issue |
You can add a <Split className="split" key={panes.length}>
{
panes.map((pane) => (
<div className="split-view-pane" key={pane.key}>
{pane.ele}
</div>
))
}
</Split> |
I used the <Split className="split" key={panes.length}>
...
</Split> |
I've got an issue where the entire Split system isn't being initialized (no gutter present) if the second of my two children is being conditionally rendered.
My second child is rendered asynchronously based on some logic, I would like for the Split system to initialize with the gutter once the second child is rendered.
Basic example would look like this:
Is it possible to do the above without having to do something like this:
The text was updated successfully, but these errors were encountered: