RangeError: Invalid string length when toJSON is not used #1803
Unanswered
roni-castro-shipt
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any alternative to tests like the one below that does not use
toJSON
, but.props
, and fails when using ref?I used this app config + added
"resolutions": { "react-is": "19.0.0" }
to check if it would solve that, like mentioned here, but it does not solve that problem.Example component with ref
Example of test that will generate huge snapshots
Snapshot generated

It generates a snapshot with 4MB, and 71363 lines. If I make it more complex, like the real case I have, it would throw
RangeError: Invalid string length
Beta Was this translation helpful? Give feedback.
All reactions