Skip to content

Commit 6c9ff7e

Browse files
authored
Merge pull request #1577 from easyops-cn/steve/jsx
fix(): refine jsx types
2 parents c54cceb + 778fcd5 commit 6c9ff7e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

bricks/basic/src/button/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useMemo, Ref } from "react";
1+
import React, { useMemo, Ref, type HTMLAttributes } from "react";
22
import { createDecorators } from "@next-core/element";
33
import {
44
ReactNextElement,
@@ -37,7 +37,7 @@ if (false) {
3737
export interface ButtonProps {
3838
type?: ButtonType;
3939
size?: ComponentSize;
40-
icon?: GeneralIconProps;
40+
icon?: GeneralIconProps & HTMLAttributes<GeneralIcon>;
4141
shape?: Shape;
4242
danger?: boolean;
4343
disabled?: boolean;
@@ -89,7 +89,7 @@ class Button extends ReactNextElement implements ButtonProps {
8989
@property({
9090
attribute: false,
9191
})
92-
accessor icon: GeneralIconProps | undefined;
92+
accessor icon: (GeneralIconProps & HTMLAttributes<GeneralIcon>) | undefined;
9393

9494
/**
9595
* 按钮形状,支持圆形、椭圆形,不设置为默认方形

bricks/basic/src/link/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React, {
44
useMemo,
55
useRef,
66
useState,
7+
type HTMLAttributes,
78
} from "react";
89
import { createDecorators } from "@next-core/element";
910
import { ReactNextElement, wrapBrick } from "@next-core/react-element";
@@ -37,7 +38,7 @@ export interface LinkProps {
3738
url?: ExtendedLocationDescriptor;
3839
href?: string;
3940
inApp?: boolean;
40-
icon?: GeneralIconProps;
41+
icon?: GeneralIconProps & HTMLAttributes<GeneralIcon>;
4142
target?: Target;
4243
showExternalIcon?: boolean;
4344
underline?: boolean;
@@ -129,7 +130,7 @@ class Link extends ReactNextElement implements LinkProps {
129130
@property({
130131
attribute: false,
131132
})
132-
accessor icon: GeneralIconProps | undefined;
133+
accessor icon: (GeneralIconProps & HTMLAttributes<GeneralIcon>) | undefined;
133134

134135
/**
135136
* 是否开启危险状态

0 commit comments

Comments
 (0)