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

feat: view组件支持配置text相关属性 & border-radius 属性值支持% #1591

Merged
merged 21 commits into from
Sep 6, 2024

Conversation

yandadaFreedom
Copy link
Collaborator

No description provided.

@yandadaFreedom yandadaFreedom changed the title feat: view组件支持配置text相关属性 feat: view组件支持配置text相关属性 & border-radius 属性值支持% Aug 30, 2024
}, {})
}

function splitProps(props: ExtendedViewStyle) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

props: ExtendedViewStyle 类型声明错了吧

const onLayout = () => {

nodeRef.current?.measure((x: number, y: number, width: number, height: number, offsetLeft: number, offsetTop: number) => {
layoutRef.current = { x, y, width, height, offsetLeft, offsetTop }
const newWidthStyleMap = percentTransform(widthRelativeStyleProps, 'width', { width })
Copy link
Collaborator

Choose a reason for hiding this comment

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

measure按条件执行

children = [<Text key='viewTextWrap' style={textStyle}>{children}</Text>]
if (every(children as ReactNode[], (child) => isText(child))) {
if (textStyle || textProps) {
children = [<Text key='viewTextWrap' style={textStyle} {...(textProps || {})}>{children}</Text>]
Copy link
Collaborator

Choose a reason for hiding this comment

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

没必要包数组

@hiyuki hiyuki merged commit f08e326 into master Sep 6, 2024
4 checks passed
@hiyuki hiyuki deleted the fix-rn-base-component branch September 6, 2024 11:34
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.

2 participants