파라미터 넘기기
import { useNavigate } from 'react-router-dom';
const navigate = useNavigate();
navigate('/PhoneProf', { state: { phoneNumber: watch('phoneVal') } })
파라미터 받기(ts)
import { useNavigate, useLocation } from 'react-router-dom';
interface ILocation {
state: {
phoneNumber: string;
};
}
const { state } = useLocation() as ILocation;
const { phoneNumber } = state;