How the tree component of antd acquires other attributes of the selected node in onSelect

the onSelect method is triggered when the tree node is selected, but the official document can only get the selectedKeys, of the selected node. As the interface needs to wear other attributes of the selected node, how to get it?

// Tree
  renderTreeNode = data => {
    return data.map(item => {
      if (item.child) {
        return (
          <TreeNode title={item.menu_name} key={item.menu_id} appId={item.app_id} dataRef={item}>
            {this.renderTreeNode(item.child)}
          </TreeNode>
        );
      }

      return <TreeNode title={item.menu_name} key={item.menu_code} dataRef={item}/>;
    });
  };
  
  


  // -------app_id
  onSelect = (selectedKeys) => {
    Message.info(selectedKeys);
    if (selectedKeys.length > 0) {
      // 
      this.setState({
        selectedKeys,
      });
    }
  };

  
  
  
Sep.03,2021

Thank you. I see. You can get it through info. DataRef will show all the attributes without attributes, as follows:

onSelect = (selectedKeys, info) => {
    Message.info(selectedKeys);
    console.log(info);
    console.log(info.node.props.dataRef.app_id);

};
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5aecb-4ccf5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5aecb-4ccf5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?