2

** In react-router v6 I am passing element so in typescript its asking for props how i can solve that**

     <Route path="dashboard" element={<Dashboard />} />
     <Route path="fellows" element={<AllFellow />} />
     <Route path="schools" element={<AllSchool />} />
     <Route path="pgestudents" element={<PgeStudents />} />
     <Route path="ecestudents" element={<EceStudents />} />
     <Route path="fellow/:fellowid" element={<IndividualFellow />} />
</Routes>```

**Type '{}' is missing the following properties from type 'Props':**



1 Answers1

0

If you have defined props correctly in the component file, you should adjust the element declaration by passing the name of the parameter e.g:

<Dashboard dashboard_id={''} />

instead of just

 <Dashboard/>

Visual studio code provides this option as a quick fix to the error

Oluwasegun Wahaab
  • 2,663
  • 3
  • 16
  • 19