@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
66Please see LICENSE files in the repository root for full details.
77*/
88
9- import React , { forwardRef } from "react" ;
9+ import React , { type Ref , type JSX } from "react" ;
1010import classNames from "classnames" ;
1111
1212/* These were earlier stateless functional components but had to be converted
@@ -16,14 +16,24 @@ presumably wrap them in a <div> before rendering but I think this is the better
1616 */
1717
1818interface ITextualCompletionProps {
19- title ?: string ;
20- subtitle ?: string ;
21- description ?: string ;
22- className ?: string ;
19+ "title" ?: string ;
20+ "subtitle" ?: string ;
21+ "description" ?: string ;
22+ "className" ?: string ;
23+ "aria-selected" ?: boolean ;
24+ "ref" ?: Ref < HTMLDivElement > ;
2325}
2426
25- export const TextualCompletion = forwardRef < ITextualCompletionProps , any > ( ( props , ref ) => {
26- const { title, subtitle, description, className, "aria-selected" : ariaSelectedAttribute , ...restProps } = props ;
27+ export const TextualCompletion = ( props : ITextualCompletionProps ) : JSX . Element => {
28+ const {
29+ title,
30+ subtitle,
31+ description,
32+ className,
33+ "aria-selected" : ariaSelectedAttribute ,
34+ ref,
35+ ...restProps
36+ } = props ;
2737 return (
2838 < div
2939 { ...restProps }
@@ -37,20 +47,21 @@ export const TextualCompletion = forwardRef<ITextualCompletionProps, any>((props
3747 < span className = "mx_Autocomplete_Completion_description" > { description } </ span >
3848 </ div >
3949 ) ;
40- } ) ;
50+ } ;
4151
4252interface IPillCompletionProps extends ITextualCompletionProps {
4353 children ?: React . ReactNode ;
4454}
4555
46- export const PillCompletion = forwardRef < IPillCompletionProps , any > ( ( props , ref ) => {
56+ export const PillCompletion = ( props : IPillCompletionProps ) : JSX . Element => {
4757 const {
4858 title,
4959 subtitle,
5060 description,
5161 className,
5262 children,
5363 "aria-selected" : ariaSelectedAttribute ,
64+ ref,
5465 ...restProps
5566 } = props ;
5667 return (
@@ -67,4 +78,4 @@ export const PillCompletion = forwardRef<IPillCompletionProps, any>((props, ref)
6778 < span className = "mx_Autocomplete_Completion_description" > { description } </ span >
6879 </ div >
6980 ) ;
70- } ) ;
81+ } ;
0 commit comments