- {snippetHit({ hit, attribute: 'name' })}
+
- {snippetHit({ hit, attribute: 'description' })}
+
diff --git a/packages/website/docs/using-react.md b/packages/website/docs/using-react.md
index e7a7c546b..b9527966c 100644
--- a/packages/website/docs/using-react.md
+++ b/packages/website/docs/using-react.md
@@ -117,8 +117,8 @@ function App() {
});
},
templates: {
- item({ item }) {
- return
;
+ item({ item, components }) {
+ return
;
}
}
}
@@ -134,31 +134,17 @@ export default App;
### Creating templates
-The example above passes `
`, another React component, for the `item` [template](templates). When creating templates, there's one thing to keep in mind. If you're using the highlighting and snippeting utilities, you must pass them React's `createElement` function. Without doing this, the utilities default to `preact.createElement` and won't work properly.
-
-The highlighting and snippeting utilities are:
-
-- [`highlightHit`](highlighthit)
-- [`snippetHit`](snippethit)
-- [`reverseHighlightHit`](reversehighlighthit)
-- [`reverseSnippetHit`](reversesnippethit)
-
-Here's an example using [`highlightHit`](highlighthit):
+The example above passes `
`, another React component, for the `item` [template](templates).
```jsx title="ProductItem.jsx"
-import { highlightHit } from '@algolia/autocomplete-js';
import React, { createElement } from 'react';
-export function ProductItem({ hit }) {
+export function ProductItem({ hit, components }) {
return (
- {highlightHit({
- hit,
- attribute: 'name',
- createElement,
- })}
+
diff --git a/packages/website/docs/using-vue.md b/packages/website/docs/using-vue.md
index 2808077ca..24160b0b8 100644
--- a/packages/website/docs/using-vue.md
+++ b/packages/website/docs/using-vue.md
@@ -136,21 +136,12 @@ This is because the default Autocomplete implementation uses [Preact's](https://
## Customizing templates
-Next, to display the results from Algolia, you need to define an [`item` template](templates). If you're using the highlighting and snippeting utilities, there's one thing to keep in mind: you must pass them Vue's `createElement` function. Without doing this, the utilities default to `preact.createElement` and won't work properly.
-
-The highlighting and snippeting utilities are:
-
-- [`highlightHit`](highlighthit)
-- [`snippetHit`](snippethit)
-- [`reverseHighlightHit`](reversehighlighthit)
-- [`reverseSnippetHit`](reversesnippethit)
-
-Here's an example of a custom `item` template using [`snippetHit`](snippethit):
+Next, to display the results from Algolia, you need to define an [`item` template](templates).
```html title="App.vue"