Skip to content

TypeError: n.props.onAction is not a function #380

@kYem

Description

@kYem

Describe the bug
onAction property is optional based on PropTypes and typescript types, however it's being called in the onClick handler, that assume onAction property is a function.

To Reproduce

Create data with nodes, that have actions array populated,
click on the node with action.

Note it was working fine on original fork version of sandbox (lib v1.13.0)
CodeSandbox Link: https://codesandbox.io/s/react-dropdown-tree-select-bvlff?file=/index.js

Expected behavior
Clicking on the node, should not throw an error.

Screenshots
image

*Environment

  • Browser Chrome 83
  • OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions