frontend-collective / frontend-collective/react-sortable-tree
Always see the type dev warning about theme.nodeContentRenderer
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 914
- PR merge metrics
- No merged PRs in 30d
Description
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`:
```JS
...
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?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the ReactSortableTree theme PropTypes declaration shown in the issue and trace how customized themes assign nodeContentRenderer. Reproduce the warning with the reported customized-theme setup, then compare the supplied value with the expected function type. Done means the warning is resolved or the expected behavior is clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100