close

[Solved] Matched leaf route at location “/” does not have an element

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use react-router But I am facing following problem Matched leaf route at location “/” does not have an element in reactjs. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Matched leaf route at location “/” does not have an element Error Occurs ?

I am trying to use react-router But I am facing following problem.

Matched leaf route at location "/" does not have an element

How To Solve Matched leaf route at location “/” does not have an element Error ?

  1. How To Solve Matched leaf route at location “/” does not have an element Error ?

    To Solve Matched leaf route at location “/” does not have an element Error If You are using V6 Then You cant Use the Component Prop. You have to use element instead of component. Now, Your Error must be solved.

  2. Matched leaf route at location “/” does not have an element

    To Solve Matched leaf route at location “/” does not have an element Error If You are using V6 Then You cant Use the Component Prop. You have to use element instead of component. Now, Your Error must be solved.

Solution 1: use element instead of component.

If You are using V6 Then You cant Use the Component Prop. You have to use element instead of component. Now, Your Error must be solved.

<Route path="/" element={<Home />}></Route>

Now, Your Error must be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read