react-component / react-component/tree
TreeNode title show '---' when title props is undefined.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 490
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 5
Description
why not show empty string('') when title is undefined?
https://github.com/react-component/tree/blob/2ed2c0943a401e3155bdbf6a57cea08cbfde6980/src/TreeNode.tsx#L13
https://github.com/react-component/tree/blob/2ed2c0943a401e3155bdbf6a57cea08cbfde6980/src/TreeNode.tsx#L622-L624
Demo:
const treeData = [
{
id: 1,
name: "test"
},
{
id: 2,
name: "test1"
}
];
export default function App() {
return (
<Tree
treeData={treeData}
titleRender={(treeNode) => <div>{treeNode.name}</div>}
/>
);
}

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/TreeNode.tsx at the referenced lines around the title prop and title rendering. Reproduce the behavior with the linked CodeSandbox demo using a tree node whose title is undefined. Done means the rendered title is an empty string instead of "---".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100