Skip to content

Commit

Permalink
fix(js): pass children as array in highlight components (#575)
Browse files Browse the repository at this point in the history
The array syntax is more conventional when using Fragments and Vue 3 doesn't support spreading children with Fragments.

Closes #574.
  • Loading branch information
francoischalifour committed May 6, 2021
1 parent 0538d40 commit 7d3402e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/autocomplete-js/src/components/Highlight.ts
Expand Up @@ -14,7 +14,7 @@ export function createHighlightComponent({
return createElement(
Fragment,
{},
...parseAlgoliaHitHighlight<THit>({ hit, attribute }).map((x, index) =>
parseAlgoliaHitHighlight<THit>({ hit, attribute }).map((x, index) =>
x.isHighlighted
? createElement(tagName, { key: index }, x.value)
: x.value
Expand Down
Expand Up @@ -14,7 +14,7 @@ export function createReverseHighlightComponent({
return createElement(
Fragment,
{},
...parseAlgoliaHitReverseHighlight<THit>({
parseAlgoliaHitReverseHighlight<THit>({
hit,
attribute,
}).map((x, index) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-js/src/components/ReverseSnippet.ts
Expand Up @@ -14,7 +14,7 @@ export function createReverseSnippetComponent({
return createElement(
Fragment,
{},
...parseAlgoliaHitReverseSnippet<THit>({
parseAlgoliaHitReverseSnippet<THit>({
hit,
attribute,
}).map((x, index) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-js/src/components/Snippet.ts
Expand Up @@ -14,7 +14,7 @@ export function createSnippetComponent({
return createElement(
Fragment,
{},
...parseAlgoliaHitSnippet<THit>({ hit, attribute }).map((x, index) =>
parseAlgoliaHitSnippet<THit>({ hit, attribute }).map((x, index) =>
x.isHighlighted
? createElement(tagName, { key: index }, x.value)
: x.value
Expand Down

0 comments on commit 7d3402e

Please sign in to comment.