jakezatecky / react-checkbox-tree

A simple and elegant checkbox tree for React.

Home Page:https://jakezatecky.github.io/react-checkbox-tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How can i change what is passed in onCheck?

pedaars opened this issue · comments

My nodes contain a count value that I would like to be able to access in the nodeinfo object of onCheck. is it possible to retrieve the full node in the node info instead of just the node value?

You can access the affected node through the second argument of the onCheck function (onCheck(nodes, node)), but unfortunately this does not pass in any custom attributes that you may have assigned to a node. We would require a slight enhancement to this library to support this.