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: 修改组件扩展运算符 #1696

Merged
merged 61 commits into from
Dec 9, 2024
Merged

Conversation

yandadaFreedom
Copy link
Collaborator

No description provided.

WX-DongXing and others added 30 commits October 31, 2024 15:49
...styles
}
const originStyle = nodeInstance.props.current.style
const finalStyle = nodeInstance.instance.style
Copy link
Collaborator

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(
Copy link
Collaborator

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 || {},
Copy link
Collaborator

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 : {},
Copy link
Collaborator

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

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, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

统一用extend吧

@hiyuki hiyuki merged commit 4c30330 into master Dec 9, 2024
6 checks passed
@hiyuki hiyuki deleted the refactor-rn-components-spread branch December 9, 2024 09:37
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.

3 participants