#community-help

Issues Upgrading react-instantsearch-dom to react-instantsearch

TLDR Akash has problems upgrading react-instantsearch-dom to react-instantsearch and gets an error for connectSortBy. Kishore Nallan advises creating a GitHub issue.

Powered by Struct AI
Oct 31, 2023 (1 month ago)
Akash
Photo of md5-5a7e6fd9a070eac5034a6034f0dc38b1
Akash
05:28 AM
Kishore Nallan i just upgrading react-instantsearch-dom to react-instantsearch getting error import React from 'react'
import { connectSortBy } from 'react-instantsearch';

function SortBy({ items, refine, createURL }) {
return (
<div style={{fontSize:'0.89rem',fontWeight:'bold',padding:"0.2rem 0.2rem"}}>
<span style={{marginRight:'1rem'}}>Sort By</span>
{items.map(item => (
<span
key={item.value}
style={{ cursor:'pointer',color: item.isRefined ? '#2248AE' : '',marginRight:"1rem",borderBottom: item.isRefined ? '2px solid #2248AE' : '' }}
onClick={event => {
event.preventDefault();
refine(item.value);
}}
>
{item.label}
</span>
))}
</div>
)
}
const CustomSortBy = connectSortBy(SortBy);

export default CustomSortBy
05:29
Akash
05:29 AM
Kishore Nallan getting error for connectSortBy
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:30 AM
Please create a GitHub issue on Typesense javascript repository. Will have someone look.