Closed vseguip closed 10 years ago
You need to provide a key in order for React to know that you deleted something. Please refer to the documentation of om.core/build
as well as this.
also take a look at http://facebook.github.io/react/docs/reconciliation.html
On Wed, Mar 12, 2014 at 4:30 PM, David Nolen notifications@github.comwrote:
Closed #143 https://github.com/swannodette/om/issues/143.
— Reply to this email directly or view it on GitHubhttps://github.com/swannodette/om/issues/143 .
Thanks a lot David, that worked like a charm. I hadn't understood exactly what that was used for when I first read that, I'm still very new to OM/React. Sorry for the noise.
Thank you for clarifying this, I too had this issue
On Wed, Mar 12, 2014 at 9:09 AM, Vicent Seguí Pascual < notifications@github.com> wrote:
Thanks a lot David, that worked like a charm. I hadn't understood exactly what that was used for when I first read that, I'm still very new to OM/React. Sorry for the noise.
Reply to this email directly or view it on GitHubhttps://github.com/swannodette/om/issues/143#issuecomment-37427496 .
Hi I'm just dabling into web frontend programming. I've been experimenting a bit with Om/React combo and I've encountered the following "bug". As I understand it, the way Om/React works is by diffing the DOM shadow rendered state vs the real DOM and rerendering what is needed. The problem I'm encountering arises when we delete an element from the middle of the list. For instance if we have a list as so [1 2 3 4 5] and we render it like so:
if we delete an element in the middle of the list (say 3) Om/React will not actually remove the DOM node corresponding to
<li>3</li>
but will actually rerender the list removing the last node (corresponding to<li>5</li>
). This causes weird things to happen specially when applying transitions. Instead of the<li>3</li>
element fading out we will observe it replaced immediately by element<li>4</li>
and the last<li>
node fading out.Following is minimal example I could come up (based on mies-om)
Index.html