StructureBuilder / react-keep-alive

A component that maintains component state and avoids repeated re-rendering.
MIT License
980 stars 105 forks source link

KeepAlive reverses {children} order. #76

Open rafegoldberg opened 4 years ago

rafegoldberg commented 4 years ago

If I write this:

<KeepAlive name="test">
  <div>One</div>
  <div>Two</div>
</KeepAlive>

I’d obviously expect to see something like:

One Two

But the HTML is actually rendered in the reverse:

<!--keep-alive-0db0de-->
<div>Two</div>
<div>One</div>
<!--keep-alive-0db0de-->

Otherwise this is a great little utility! Thanks for your work on this.

rafegoldberg commented 4 years ago

My system details:

React: v16.12.0 Node: v10.16.0 macOS: v10.15.3

AlexandreUser commented 3 years ago

I have this same issue