File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/docsearch-react/src Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export type ResultsTranslations = Partial<{
1313} > ;
1414interface ResultsProps < TItem extends BaseItem >
1515 extends AutocompleteApi < TItem , React . FormEvent , React . MouseEvent , React . KeyboardEvent > {
16- title : string ;
16+ title ? : string | null ;
1717 translations ?: ResultsTranslations ;
1818 collection : AutocompleteState < TItem > [ 'collections' ] [ 0 ] ;
1919 renderIcon : ( props : { item : TItem ; index : number } ) => React . ReactNode ;
@@ -25,7 +25,12 @@ interface ResultsProps<TItem extends BaseItem>
2525
2626export function Results < TItem extends StoredDocSearchHit > ( props : ResultsProps < TItem > ) : JSX . Element | null {
2727 // The collection title, decoded to handle encoded HTML entities
28+ // If there is not a title, return null to not render anything
2829 const decodedTitle = React . useMemo ( ( ) => {
30+ if ( ! props . title ) {
31+ return null ;
32+ }
33+
2934 return props . title
3035 . replace ( / & a m p ; / g, '&' )
3136 . replace ( / & l t ; / g, '<' )
You can’t perform that action at this time.
0 commit comments