just follow this code :
use useRef hook and assign a Ref to Carousel and then call next and prev method by refrence.
import React, { useRef, Fragment } from "react";
import { Carousel } from "antd";
const MyCarousel = () => {
const slider = useRef(null);
return (
Item 1
Item 2
Item 3
)}