Accessing object from renderHits with instantSearch.js


I want to access the object values ​​through the render function in order to display the values ​​in a table.

// Create the render function
const renderHits = (renderOptions, isFirstRender) => {
    const { hits, widgetParams } = renderOptions;

    widgetParams.container.innerHTML = `
            item =>
                        ${instantsearch.highlight({ attribute: 'name', hit: item })}
                        ${instantsearch.highlight({ attribute: 'nationality_text', hit: item })}
                        // languages is an object, i want to access to languages.language_text
                        // Output in my HTML : 
                        // [object Object]

Capture d’écran 2022-02-21 à 11.19.02

Thank you very much in advance for your help

1 Like