React-sortable-tree: Can we pass a function to handle onClick event

Created on 27 Aug 2019  路  2Comments  路  Source: frontend-collective/react-sortable-tree

This is a question.

Wonder if it is possible to pass in a onclick handle function, which will be called with the title of the node that was clicked.

Thanks in advance!

Most helpful comment

I assume you're referring to handling any click within the node contents? I just created a quick example. You can create an onClick handler and pass it in the generateNodeProps prop.

https://codesandbox.io/embed/rstnodeclickhandler-81sew

All 2 comments

I assume you're referring to handling any click within the node contents? I just created a quick example. You can create an onClick handler and pass it in the generateNodeProps prop.

https://codesandbox.io/embed/rstnodeclickhandler-81sew

Thanks @nreis11 for going out of your way and creating a working example!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CrazyCodingBanana picture CrazyCodingBanana  路  4Comments

LogicMonsters picture LogicMonsters  路  5Comments

bigjujube picture bigjujube  路  4Comments

vladimirsvsv77 picture vladimirsvsv77  路  5Comments

29er picture 29er  路  5Comments