Skip to content

Commit 51cf9aa

Browse files
committed
Removes isRequired for Node.name propType
1 parent 9084afc commit 51cf9aa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

react-d3-tree.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ declare module "react-d3-tree" {
55
}
66

77
type ReactD3TreeItem = {
8-
name: string,
8+
name?: string,
99
attributes?: {
1010
[key: string]: string,
1111
};

src/Node/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export default class Node extends React.Component {
127127

128128
Node.defaultProps = {
129129
nodeLabelComponent: null,
130+
name: '',
130131
attributes: undefined,
131132
circleRadius: undefined,
132133
styles: {
@@ -153,7 +154,7 @@ Node.propTypes = {
153154
onClick: T.func.isRequired,
154155
onMouseOver: T.func.isRequired,
155156
onMouseOut: T.func.isRequired,
156-
name: T.string.isRequired,
157+
name: T.string,
157158
attributes: T.object,
158159
textLayout: T.object.isRequired,
159160
subscriptions: T.object.isRequired, // eslint-disable-line react/no-unused-prop-types

0 commit comments

Comments
 (0)