odd runtime error but just for mobile
The problem ONLY occurs when a mobile devices (touch devices) clicks on the filter
select
element and selects the default value while it already is set to the default value. In our case the default value is recent
.
Just to reiterate on the just "mobile" part of the title. If I'm using just the responsive
mobile view in the dev tools everything works. If I select a device, say nexus 6p
, and then try to select recent
with it already being set to recent
I receive the following error(or see screenshot):
Unhandled Runtime Error TypeError: Converting circular structure to JSON
I have the following:
A trpc (v9) endpoint to an infinite react query, v3 if that matters
I don't think this is the culprit
The filter
is tied to a Radix Select
like this:
The Select
component is messy, I'll provide a code sandbox and say that my bets are on onValueChangeFx
or onItemClickFx
.
https://codesandbox.io/s/laughing-orla-sgfc1t?file=/src/select.tsx
Googling the err msg points to people using JSON.stringify()
on objects that point to themselves. which afaik I didn't doCodeSandbox
laughing-orla-sgfc1t - CodeSandbox
laughing-orla-sgfc1t using @radix-ui/react-select, autoprefixer, postcss-cli, react, react-dom, react-icons, react-scripts, tailwindcss, zod
0 Replies