-
Notifications
You must be signed in to change notification settings - Fork 382
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: 修改组件扩展运算符 #1696
chore: 修改组件扩展运算符 #1696
Conversation
...styles | ||
} | ||
const originStyle = nodeInstance.props.current.style | ||
const finalStyle = nodeInstance.instance.style |
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.
直接传递style就可以了,不需要读取props中的style
currentTarget: { | ||
...(event.currentTarget || {}), | ||
|
||
const currentTarget = extendObject( |
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.
extendObject的设计需要对齐Object.assign,不要默认加入空对象,保障方法的灵活性
...(event.currentTarget || {}), | ||
|
||
const currentTarget = extendObject( | ||
event.currentTarget || {}, |
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.
Object.assign接收undefined,不需要兜底空对象
} | ||
const defaultViewStyle = extendObject( | ||
styles.button, | ||
isMiniSize ? styles.buttonMini : {}, |
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.
兜底直接用null可以
@@ -46,7 +46,7 @@ export interface CheckboxProps extends Selection { | |||
'parent-height'?: number; | |||
children?: ReactNode | |||
bindtap?: (evt: NativeSyntheticEvent<TouchEvent> | unknown) => void | |||
catchtap?: (evt: NativeSyntheticEvent<TouchEvent> | unknown) => void | |||
_onChange?: (evt: NativeSyntheticEvent<TouchEvent> | unknown, { checked }: { checked: boolean }) => void |
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.
这个是干嘛的
}) | ||
} | ||
if (bindmessage) { | ||
Object.assign(events, { |
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.
统一用extend吧
Refactor rn components spread cr
No description provided.