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

moment should be null or undefined by default #276

Open
alex2wong opened this issue Feb 19, 2020 · 0 comments
Open

moment should be null or undefined by default #276

alex2wong opened this issue Feb 19, 2020 · 0 comments

Comments

@alex2wong
Copy link

alex2wong commented Feb 19, 2020

When I was using typescript with ant-motion, I found moment set to null is unacceptable.
since the typing as follow:

export interface IProps<T> extends Omit<React.HTMLAttributes<T>, 'onChange'> {
  animation?: IAnimObject | IAnimObject[];
  paused?: boolean;
  reverse?: boolean;
  reverseDelay?: number;
  repeat?: number;
  yoyo?: boolean;
  onChange?: (e: IChangeProps) => void;
  moment?: number;  // should be number or undefined.
  attr?: IAttrType,
  resetStyle?: boolean,
  component?: string | React.ReactNode;
  componentProps?: {};
}

In vanilla Javascript, it is OK to set as null. but not in typescript, maybe you could change the API doc, to avoid misunderstanding.

https://motion.ant.design/api/tween-one-cn#API

API doc

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

1 participant