BASIC URL Example not working

I am new to Algolia and going through the documentation to integrate Algolia on my React site but I am having trouble getting the BASIC URL example to work. I followed all the steps but get this error when trying to load my site:
TypeError: Cannot destructure property 'search' of 'undefined' as it is undefined. > const urlToSearchState = ({ search }) => qs.parse(search.slice(1));

I have followed the instructions and there are no typos. I have also seen this thread but was unable to get it to work as well.

Hi @cmc, Could you provide a codesandbox demonstrating the issue? I have one started for you here that’s using the basic url example.

@cindy.cullen: I created a sandbox, I realize that the example in the documentation is using React Router and I am using Next JS in my app so switched those calls. I am also using Hooks so tried to convert the Class component into a functional component with hooks (though I think I might of missed some things, React newbie :expressionless:)

Hey, you’ve probably not saved your changes because I still see a Class component, but anyway, the example works :slightly_smiling_face:
Let us know if you manage to reproduce your issue!