chore: avoid using delete (#4923)

This commit is contained in:
neverland 2019-11-05 09:36:25 +08:00 committed by GitHub
parent 56e9b7afa0
commit fbb34a0f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -84,7 +84,7 @@ function Search(
};
const inheritData = inherit(ctx);
delete inheritData.attrs;
inheritData.attrs = undefined;
return (
<div

View File

@ -62,13 +62,12 @@ function createInstance() {
// transform toast options to popup props
function transformOptions(options) {
options = { ...options };
options.overlay = options.mask;
delete options.mask;
delete options.duration;
return options;
return {
...options,
overlay: options.mask,
mask: undefined,
duration: undefined
};
}
function Toast(options = {}) {