-
Notifications
You must be signed in to change notification settings - Fork 84
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
fix Card not re-render if state change on parent #89
base: master
Are you sure you want to change the base?
Conversation
@webraptor Hi, i made some changes related to #85. can you please merge and release asap? thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see how this helps. Please provide extra info on the change, testing etc.
@@ -68,7 +68,8 @@ class Swiper extends Component { | |||
const { props, state } = this | |||
const propsChanged = ( | |||
!isEqual(props.cards, nextProps.cards) || | |||
props.cardIndex !== nextProps.cardIndex | |||
props.cardIndex !== nextProps.cardIndex || | |||
props.renderCard !== nextProps.renderCard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iyansr how does comparing the renderCard function help? I'm pretty sure it will not work or improve the swiper in any way, at least not without introducing a lot of other issues for other people.
@iyansr Thanks this code worked for me. I am using this deck swiper to render questions. and my requirement was, whenever the user tap on the card user should view their answer on the card, This could happen because of your code. I added your code in node_modules directly. |
glad it helps @hmdrx ! |
@webraptor seems like someone have similar problem :D |
Thank you and it works @iyansr |
Related: #85