Skip to content
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

Updating preventSwipe prop after initial render does not take effect #30

Open
benkaiser opened this issue Dec 16, 2020 · 3 comments
Open

Comments

@benkaiser
Copy link

Only the preventSwipe prop passed on initial render of a tinder card is taken into account. If you proceed to update the prop later with a new set of prevented directions, they will not take effect.

I'm not that great with hook components in React. I tried adding [preventSwipe] to the deps of the React.useLayoutEffect but it didn't seem to fix the behavior.

benkaiser added a commit to benkaiser/react-tinder-card that referenced this issue Dec 16, 2020
@benkaiser
Copy link
Author

Fixed in this PR: #31

@3DJakob
Copy link
Owner

3DJakob commented Dec 24, 2020

Great addition, good catch! I will take a look at your PR and merge it asap!

@shubhurwt2001
Copy link

Hi, I'm still not able to fix this issue. Can someone help? I'm working with react-tinder-card 1.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants