frontend-collective / react-sortable-tree

Drag-and-drop sortable component for nested data and hierarchies
https://frontend-collective.github.io/react-sortable-tree/
MIT License
4.91k stars 904 forks source link

Always see the type dev warning about theme.nodeContentRenderer #865

Open heimmen opened 3 years ago

heimmen commented 3 years ago

We are integrating react-sortable-tree with a customized theme. When loading the tree, we always see the warning:

Warning: Failed prop type: Invalid prop `theme.nodeContentRenderer` of type `object` supplied to `ReactSortableTree`, expected `function`.

We check the source code, the theme.nodeContentRenderer prop is defined as PropTypes.func:

...
  theme: PropTypes.shape({
    style: PropTypes.shape({}),
    innerStyle: PropTypes.shape({}),
    reactVirtualizedListProps: PropTypes.shape({}),
    scaffoldBlockPxWidth: PropTypes.number,
    slideRegionSize: PropTypes.number,
    rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    treeNodeRenderer: PropTypes.func,
    nodeContentRenderer: PropTypes.func,
    placeholderRenderer: PropTypes.func,
  }),
...

Is it right?

AinoLe commented 3 years ago

Same issue here