Asynchronously loaded antd Tree component that sets defaultExpandAll to true but does not work

the main code is as follows, but the rendered tree is all turned off. How to solve it? Thank you ~

componentDidMount() {
    // TreeData
  getTreeData = (appId) => {
    const { dispatch } = this.props;
    const { selectedKeys } = this.state;
    dispatch({
      type: "auth/getTreeData",
      payload: {
        appId, // 
      },
      callback: (data) => {
        if(data.isSuccess){
          this.setState({       //state
            treeData: data.res,     
          });
        }
      },
    });
  }
}

//render
<Tree
  defaultExpandAll
  onSelect={this.onSelect}
>
  {this.renderTreeNode(treeData)}
</Tree>

Sep.07,2021

get the data and then render tree,. Do not render tree when there is no data

//render
{treeData&&
<Tree
  defaultExpandAll
  onSelect={this.onSelect}
>
  {this.renderTreeNode(treeData)}
</Tree>:null}
Menu