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

[Chore]: Technical: Translate components/common final part #1750

Conversation

dariaterekhova-actionengine
Copy link
Collaborator

Signed-off-by: Daria Terekhova daria.terekhova@actionengine.com

// TODO: convert the entire component to use hooks in the next PR
static defaultProps = {
Copy link
Contributor

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

Copy link
Collaborator Author

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
Copy link
Contributor

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;
Copy link
Contributor

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>
@dariaterekhova-actionengine dariaterekhova-actionengine force-pushed the dt/js_to_ts_convertion_components_common_part2 branch from 9db42e1 to ef469dc Compare March 25, 2022 12:09
@delete-merged-branch delete-merged-branch bot deleted the dt/js_to_ts_convertion_components_common_part2 branch March 25, 2022 12:10
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

Successfully merging this pull request may close these issues.

None yet

2 participants