-
Notifications
You must be signed in to change notification settings - Fork 734
Carousel - remove unsafe method #941
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
Conversation
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.
I pushed a fix to the file code format, I think you formatted it before we fixed .prettierrc config.
Anyway, try to add description to PRs even when seem trivial (unless it's a one line fix)
I won't necessarily be the one that review them and it's important to understand what you fix here and how.
} | ||
|
||
static getDerivedStateFromProps(nextProps, prevState) { | ||
const {currentPage, prevProps} = prevState; |
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.
Is there a reason to keep the whole "prevProps" in state?
Why not just keep the initialPageWidth in state and check against its value.
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.
I'm using 'pageWidth', 'containerMarginHorizontal', 'loop' for the prevProps and passing them to 'presenter.calcOffset()'
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.
👍
No description provided.