React-native-interactable: how to change the swipe back to original state after I press the delete button

Created on 20 Mar 2017  路  10Comments  路  Source: wix/react-native-interactable

alt text

I use react-native-interactable to make a swipeout demo
After I press the delete button锛宼he UI rerender but the swipe effect is still there.

Most helpful comment

Hello Colin can you please try key attribute with a unique id for the render method of listview?

renderRow (line, sectionID) {
    return (
      <Row key={line.id} ...

All 10 comments

I need the right effect is when I press delete button,this row delete.
The next row is close state.

Would the new setVelocity function described in #18 be of assistance? (iOS only for now)

@iamtommcc

I found the setVelocity funciton ,But don't known how to use the function.

The Doc not write how to use the setVelocity function
this.refComp.setVelocity(...) ?

I tried,but got undefine setVelocity error

Hello Colin can you please try key attribute with a unique id for the render method of listview?

renderRow (line, sectionID) {
    return (
      <Row key={line.id} ...

Seconding the answer by @tasarsu. What happens here is that React is recycling the component and "moving" your rows into the existing native components instead of destroying and creating new ones. This can be avoided by letting React know that these components are different instances, ie using the key prop for the rows. React will not recycle the native view if the key is different.

I will try @tasarsu's way.
Thanks @tasarsu and @talkol .

Please close the issue if you manage to get this working. If not, please post a small demo project and we'll help you fix it

Please reopen if this issue is still a problem

@colin3dmax can you provide us with the code

I try it but it doesn't work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

motiazu picture motiazu  路  5Comments

dmitryusikriseapps picture dmitryusikriseapps  路  3Comments

arqex picture arqex  路  3Comments

BogdanRad picture BogdanRad  路  4Comments

yash2code picture yash2code  路  7Comments