-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Chore]: Technical: Translate components/common final part #1750
[Chore]: Technical: Translate components/common final part #1750
Conversation
// TODO: convert the entire component to use hooks in the next PR | ||
static defaultProps = { |
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 we can't keep defaultProps
? I find it a lot more sane then adding values wherever we deconstruct this.props
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.
The problem of defaultProps is that typescript doesn't see it. So sometimes I should duplicate it with deconstruction default values... But I'll keep it for the cases where it's not necessary
@@ -118,8 +124,9 @@ function AnimationControllerFactory() { | |||
}; | |||
|
|||
_resetAnimtionByTimeStep = () => { | |||
const {steps = []} = this.props |
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.
default value for steps
should null
add below to this function
if (!steps) return;
@@ -200,7 +207,7 @@ function AnimationControllerFactory() { | |||
} | |||
|
|||
_nextFrameByTimeStep() { | |||
const {steps, value} = this.props; | |||
const {steps = [], value} = this.props; |
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.
same as above default value for steps
should be null
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
9db42e1
to
ef469dc
Compare
Signed-off-by: Daria Terekhova daria.terekhova@actionengine.com