react-inspector icon indicating copy to clipboard operation
react-inspector copied to clipboard

expandLevel infinity

Open Hurtak opened this issue 8 years ago • 2 comments

Hi,

I would like to propose API change so that the expandLevel also takes Infinity. Currently, it is not possible to set the tree view to the fully expanded state by any other way than by setting expandLevel to some arbitrarily large number.

I also tried Number.MAX_SAFE_INTEGER but that (along with Infinity) causes to throw `Invalid array length'.

Hurtak avatar May 17 '17 12:05 Hurtak

I cannot verify right now because I am at a different computer, but I had some object with like 10 levels, and expanding to all levels with expandLevel=100 was noticeably slower than expandLevel=15. I Will try to investigate more tomorrow.

Hurtak avatar May 17 '17 20:05 Hurtak

@Hurtak sounds reasonable enough to me, would you be able to open a PR?

ndelangen avatar Dec 12 '17 14:12 ndelangen