Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceeded #11

Open
Protonex opened this issue Nov 2, 2018 · 3 comments
Open

Maximum call stack size exceeded #11

Protonex opened this issue Nov 2, 2018 · 3 comments

Comments

@Protonex
Copy link

Protonex commented Nov 2, 2018

When data had 2 or more top levels 'root' there is stack overflow occured.
Here is representation:

https://repl.it/@Nexis/NotableElegantLaws

Just remove top root level and all works fine.

@vosho
Copy link

vosho commented Dec 15, 2018

The same issue here

@ramax495
Copy link

It seems that problem is in "ParentId": 0
Lib considers it as undefined.

@sheerLi
Copy link

sheerLi commented Apr 14, 2020

The default rootID value is '0'. According to the source code analysis, if the customID and rootID passed in the data are repeated. Then this problem will occur. Therefore, I think a better solution is to customize the rootID configuration to ensure that the rootID is unique.
such as
const tree = arrayToTree(array, { parentProperty: 'ParentId', customID: 'Id', rootID: 'root' });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants