Answers for "how to pass data through link in react router"

2

send data through routes in react

const navigate = useNavigate();
navigate('/other-page', { state: { id: 7, color: 'green' } });
Posted by: Guest on April-11-2022
0

how to send data between components in react using link

<Link
  to={{
    pathname: "/page",
    state: data // your data array of objects
  }}
>
Posted by: Guest on September-07-2021
0

send data through routes in react

const {state} = useLocation();
const { id, color } = state; // Read values passed on state
Posted by: Guest on April-11-2022

Code answers related to "how to pass data through link in react router"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language