React 使用树形组件在删除搜索框中的数据的时候会异常

我编写了一个组件设置了默认的节点值,我在先输入值再对搜索框清空文本的时候抛出异常了

无法在“节点”上执行“removeChild”:要删除的节点不是此节点的子节点。
 在删除儿童 (http://localhost:3000/static/js/bundle.js:46590:22)
代码如下
import React, { useState, useEffect} from 'react';
import { TreeSelect } from 'antd';
const { SHOW_PARENT } = TreeSelect;
const treeData = [
  {
    title: 'Node1',
    value: '0-0',
    key: '0-0',
    children: [
      {
        title: 'Child Node1',
        value: '0-0-0',
        key: '0-0-0',
      },
    ],
  },
];

const App = () => {
  const [value, setValue] = useState(undefined);
  useEffect(() => {
    setValue([]);
  }, []);
  const onChange = (newValue) => {
    if (newValue !== null && newValue !== undefined) {
      setValue(newValue);
    }
  };

  const tProps = {
    treeData,
    value,
    onChange,
    treeCheckable: true,
    showCheckedStrategy: SHOW_PARENT,
    placeholder: 'Please select',
    style: {
      width: '100%',
    },
  };

  return <TreeSelect {...tProps} />;
};

export default App;
我的理解是这个搜索框没有值了,再去删除逻辑存在问题应该添加验证

我试了你的代码没发现报错