Skip to content
Discussion options

You must be logged in to vote

This probably could be documented more clearly indeed, but the RouteState defaults to UiState, so if you transform it, you should pass the generic to InstantSearch like this:

import type { SearchClient, UiState } from 'instantsearch.js';
import React from 'react';
import { InstantSearch } from 'react-instantsearch-hooks';
import { createInstantSearchRouterNext } from 'react-instantsearch-hooks-router-nextjs';
import singletonRouter from 'next/router';

type RouteState = {
  q?: string;
  timing?: string[];
  theme?: string[];
  type?: string[];
  technology?: string[];
  sortBy?: string;
  page?: number;
};

export function App({
  indexName,
  searchClient,
}: {
  indexName: string;
  se…

Replies: 1 comment 28 replies

Comment options

You must be logged in to vote
28 replies
@Haroenv
Comment options

@tom-radikal
Comment options

@Haroenv
Comment options

@tom-radikal
Comment options

@tom-radikal
Comment options

Answer selected by tom-radikal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants