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

Expose row index to Node renderer #86

Open
joshhunt opened this issue Mar 28, 2022 · 3 comments
Open

Expose row index to Node renderer #86

joshhunt opened this issue Mar 28, 2022 · 3 comments

Comments

@joshhunt
Copy link

I'm trying to give my rows alternate "striped" colors. Using :nth-child(2n + 1) is not great because you get a weird effect as you scroll as items are added and removed from the div.

It would be handy if react-vtree exposed the current row index to the Node renderer. It looks like this is already available internally https://github.com/Lodin/react-vtree/blob/f4d9cd4/src/Tree.tsx#L187

@gregjoeval
Copy link

this would also be helpful for debugging purposes

@egorzalenski
Copy link

Hi @joshhunt ,
Have you found a solution on how to implement it without changing the source code of the package?

@joshhunt
Copy link
Author

No - I changed the code 😌

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

Successfully merging a pull request may close this issue.

3 participants