-
I have this: templates: {
item({ item }) {
return `<div>
<a href="/things/${item.objectID}">${item.title}</a>
</div>`
},
noResults() {
return 'No results.';
},
}, And it shows up like this: Any idea how to fix the template to not escape the HTML? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
you can use jsx as html is indeed escaped. For example: https://codesandbox.io/s/nostalgic-pasteur-mdsff?file=/app.js templates: {
item({ item }) {
// you can use jsx
return (
<div>
<a href={`/things/${item.objectID}`}>{item.name}</a>
</div>
);
},
noResults() {
// you can also use "h" directly:
return h('div', {}, h('a', { href: '/' }, 'no results link'));
},
},
}, |
Beta Was this translation helpful? Give feedback.
-
Since the latest version of autocomplete, you can now use the exposed |
Beta Was this translation helpful? Give feedback.
you can use jsx as html is indeed escaped. For example: https://codesandbox.io/s/nostalgic-pasteur-mdsff?file=/app.js