Recoil: Infinity loop occurs if the value to be set has a circular reference

Created on 16 May 2020  路  2Comments  路  Source: facebookexperimental/Recoil

Hi there,

I've found infinity loop problem if the value to be set has a circular reference.
Is it bug or limitation of recoil?

Minimum reproduction:
https://codesandbox.io/s/intelligent-matsumoto-vsw7m?file=/src/App.js

Actual behavior:

RangeError: Maximum call stack size exceeded

Expected behavior:

The value can be set without error.

bug

Most helpful comment

Yes, looks like that's a current bug of our internal hashing.

All 2 comments

Yes, looks like that's a current bug of our internal hashing.

As a temporary workaround you can add dangerouslyAllowMutability: true to the atom options. This prevents us from deep-freezing the value which is where this is happening.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sawtaytoes picture Sawtaytoes  路  4Comments

jamiewinder picture jamiewinder  路  3Comments

ymolists picture ymolists  路  3Comments

jamiebuilds picture jamiebuilds  路  3Comments

yuantongkang picture yuantongkang  路  3Comments