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

feature request: provide current element depth to visitor function #35

Open
alidcast opened this issue Jun 21, 2018 · 1 comment
Open

Comments

@alidcast
Copy link

Hey @ctrlplusb, thanks for extracting this utility out for other libraries!

would you be inclined to pass the current element depth/index in the tree as the last argument to the visitor function? It's useful if you want to limit how far down you want to walk the component tree, e.g. if implementing a custom getInitialProps

Thanks

@alidcast
Copy link
Author

alidcast commented Jun 21, 2018

upon opening this I realized there might be a way I can implement the feature I have in mind without knowing the element's depth

but I'll keep this issue open in case you're interested in it

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

1 participant