lewat keadaan dalam reaksi tautan

import { useNavigate } from "react-router-dom";
const history = useNavigate();

history('/send-message', {state: 'data'});


import { useLocation } from "react-router-dom";
const location = useLocation();

console.log(location.state);
Niraj Kafle