Skip to content

Commit ec610fb

Browse files
authored
Merge pull request #63 from 1Byte-Software/fix/fix-typography-text
fix: remove onChange prop in TypographyText
2 parents 97f8b07 + e2be9fc commit ec610fb

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed
Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
import { forwardRef, useMemo } from 'react';
1+
import { forwardRef } from 'react';
22
import { Skeleton } from '../../molecules';
33
import { TypographyTextStyles } from './styles';
44
import { RdTypographyTextProps } from './types';
55
import { detectHeightBySize } from './TypographyText.helper';
66

77
export const TypographyText = forwardRef(
88
(props: RdTypographyTextProps, ref: RdTypographyTextProps['ref']) => {
9-
const {
10-
size = 'normal',
11-
editable,
12-
autoFocus = false,
13-
loading = false,
14-
onChange,
15-
...antdProps
16-
} = props;
9+
const { size = 'normal', autoFocus = false, loading = false, ...antdProps } = props;
1710

1811
if (loading) {
1912
return (
@@ -26,20 +19,6 @@ export const TypographyText = forwardRef(
2619
);
2720
}
2821

29-
const editableCustom = useMemo(() => {
30-
if (editable && typeof editable === 'object') {
31-
if (onChange) {
32-
editable.onChange = onChange;
33-
}
34-
35-
return editable;
36-
}
37-
38-
return editable;
39-
}, [editable]);
40-
41-
return (
42-
<TypographyTextStyles ref={ref} editable={editableCustom} size={size} {...antdProps} />
43-
);
22+
return <TypographyTextStyles ref={ref} size={size} {...antdProps} />;
4423
}
4524
);

0 commit comments

Comments
 (0)