1

I want to directly send props to a component. Is there a way to do this?

const navigate = useNavigate();

useEffect(()=>{

                .....
        
     
                    navigate ("/projectpage"); //send props here
           
    },[]);
TranceAddict
  • 187
  • 3
  • 14

1 Answers1

1

The most common way of tackling this need is to pass the data as params to your navigation that you can access with the useParams hook.

Here's the docs from React Router

Here's a good guide on how to use it in practice

Jorge
  • 111
  • 4