Domain: APIP2Package: coreStatus: to triageType: breaking changeType: enhancementhelp wanted
仓库指标
- Star
- (20,263 star)
- PR 合并指标
- (平均合并 43天 10小时) (30 天内合并 27 个 PR)
描述
Environment
- Package version(s):
- Browser and OS versions:
Feature request
/**
* An optional custom user object to associate with the node.
* This property can then be used in the `onClick`, `onContextMenu` and `onDoubleClick`
* event handlers for doing custom logic per node.
*/
nodeData?: T;
should not be optional. It prevents type checking. If a user wants that to be optional then they can pass in undefined as a union for the generic parameter
Examples
can't do:
const a: ITreeNode<{type: "a"}> = {} as ITreeNode<{type: "a"}>;
if (a.dataNode.type == "a") // can't do this as a.dataNode can be undefined
if user actually wants undefined they can do ITreeNode<{type: "a"} | undefined>