If you are getting “Unexpected token string..” error when adding query parameters or passing props in a widget in React instantSearch, you can check if your values contain spaces or apostrophes.
If it contains spaces, you can enclose the whole value in single quotes.
{ “filters”: “color:’Navy Blue’” }
or
filters={“color:’Navy Blue’”}
If the value has an apostrophe(‘), you can put two backslashes in front of apostrophes and enclose the whole value in single quotes.
{ “filters”: “type:‘women\\’s’”}
or
filters={“type:‘women\\’s’”}
Comments
0 comments
Please sign in to leave a comment.