Open mattiaerre opened 5 years ago
also if I run:
npx react-component-hierarchy app.js
I've got this output:
npx: installed 14 in 2.994s
colors[(node.depth || 0)] is not a function
it looks like the issue is in the github:surreal9/pretty-tree
package; if the app has got node w/ depth >= colors.length - 1
it throws the above error. so either this package uses the unforked pretty-tree
or the forked version should be fixed w/ something like:
colors[node.depth || 0](node.label);
colors[node.depth % colors.length](node.label);
// cc @Surreal9
am getting the same issue. +1 for that
I forked this and then forked pretty-tree, made the suggested change from above, and it solved this. https://github.com/jeffymahoney/react-component-hierarchy
Context
What are you trying to achieve or the steps to reproduce?
npx react-component-hierarchy -c ./index.js
What were your results?
What did you expect?
To see my components' tree