Skip to content

Commit 217a140

Browse files
committed
fix: forbid returning null from tree walker
1 parent 0daffe9 commit 217a140

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

__stories__/FixedSizeTree.story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const defaultButtonStyle = {fontFamily: 'Courier New'};
5252

5353
function* treeWalker(
5454
refresh: boolean,
55-
): IterableIterator<CommonNodeMetadata | string | symbol | null> {
55+
): IterableIterator<CommonNodeMetadata | string | symbol> {
5656
const stack: StackElement[] = [];
5757

5858
stack.push({

__stories__/VariableSizeTree.story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const TreePresenter: React.FunctionComponent<TreePresenterProps> = ({
109109
const treeWalker = React.useCallback(
110110
function*(
111111
refresh: boolean,
112-
): IterableIterator<VariableSizeNodeMetadata | string | symbol | null> {
112+
): IterableIterator<VariableSizeNodeMetadata | string | symbol> {
113113
const stack: StackElement[] = [];
114114

115115
stack.push({

__tests__/FixedSizeTree.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('FixedSizeTree', () => {
4343

4444
treeWalkerSpy = jest.fn(function*(
4545
refresh: boolean,
46-
): IterableIterator<FixedSizeNodeMetadata | string | symbol | null> {
46+
): IterableIterator<FixedSizeNodeMetadata | string | symbol> {
4747
const stack: StackElement[] = [];
4848

4949
stack.push({

__tests__/VariableSizeTree.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('VariableSizeTree', () => {
4646

4747
treeWalkerSpy = jest.fn(function*(
4848
refresh: boolean,
49-
): IterableIterator<VariableSizeNodeMetadata | string | symbol | null> {
49+
): IterableIterator<VariableSizeNodeMetadata | string | symbol> {
5050
const stack: StackElement[] = [];
5151

5252
stack.push({

src/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface TreeProps<TMetadata extends CommonNodeMetadata> {
6161
readonly rowComponent?: React.ComponentType<ListChildComponentProps>;
6262
readonly treeWalker: (
6363
refresh: boolean,
64-
) => IterableIterator<TMetadata | string | symbol | null>;
64+
) => IterableIterator<TMetadata | string | symbol>;
6565
}
6666

6767
export interface TreeState<T extends CommonNodeRecord> {

0 commit comments

Comments
 (0)