File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,7 @@ class Hyperlink extends Component<HyperlinkProps, HyperlinkState> {
9696 let elements : Array < string | React . ReactElement > = [ ] ;
9797 let _lastIndex = 0 ;
9898
99- // Create component props (ref and key are React-specific and not in TextProps)
100- const componentProps = component . props as TextProps ;
101- delete ( componentProps as { ref ?: unknown } ) . ref ;
102- delete ( componentProps as { key ?: unknown } ) . key ;
99+ const { ref : _ref , key : _key , ...componentProps } = component . props || { } ;
103100
104101 try {
105102 this . state . linkifyIt
@@ -161,9 +158,7 @@ class Hyperlink extends Component<HyperlinkProps, HyperlinkState> {
161158 let { props : { children } = { children : undefined } } = component || { } ;
162159 if ( ! children ) return component ;
163160
164- const componentProps = component . props as TextProps ;
165- delete ( componentProps as { ref ?: unknown } ) . ref ;
166- delete ( componentProps as { key ?: unknown } ) . key ;
161+ const { ref : _ref , key : _key , ...componentProps } = component . props || { } ;
167162
168163 return React . cloneElement (
169164 component ,
@@ -229,4 +224,4 @@ export default class extends Component<HyperlinkProps> {
229224 < Hyperlink { ...rest } />
230225 ) ;
231226 }
232- }
227+ }
You can’t perform that action at this time.
0 commit comments