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

[exception] toValue is not defined #23

Open
almorak opened this issue Aug 12, 2020 · 1 comment
Open

[exception] toValue is not defined #23

almorak opened this issue Aug 12, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@almorak
Copy link

almorak commented Aug 12, 2020

"react-native-flip-toggle-button": "^1.0.8",

toValue is not defined.

solved:
1.
constructor(props) {
...
let toValue = 0; <---- add defined
if (this.props.value) {
toValue = toValue = this.dimensions.buttonWidth - this.dimensions.translateX;
} else {
toValue = 0;
}
...
}

componentDidUpdate(prevProps) {
...
let toValue = 0; <---- add defined
if (currentProps.value) {
toValue = toValue = this.dimensions.buttonWidth - this.dimensions.translateX;
} else {
toValue = 0;
}
...
}

please update

@ashishpandey001
Copy link
Owner

@almorak good catch! Thanks. I major upgrade is on the way, I'll resolve this in that.
Also, could you also share the props that you used when you came across this exception?

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

No branches or pull requests

2 participants