How to call methods of antd component

The

ant design component is similar to how this method is called, unlike the parameters of the component. I don"t know how to use it. Ask for advice.

Mar.23,2021

  constructor(props) {
    super(props);

    this.carouselRef = null;

    this.setCarouselRef = el => {
      this.carouselRef = el;
    };
  }

  componentDidMount() {
    // 
    if (this.carouselRef) this.carouselRef.next();
  }

  // render
  <Carousel ref={this.setCarouselRef} ></Carousel>

if my button event is transferred in another component, binding ref to the component prints out the following

Menu