i am working on project that displays list of doctors.i am trying nested routing like below. when i go to /book-appointment page nothing is displayed and there is no error shown console but appointment component is not rendered. i am confused with nested Routes and i dont know what mistake i am making here
Layout.js
<Route path="/" exact component={Sections} />
<Route
path="/doctors"
render={(props) => {
return this.state.doctors_list.map((doctor, index) => {
return (
<Doctors
key={index}
clinic_name={doctor.clinic_name}
doctor_name={doctor.doctor_name}
speciality={doctor.speciality}
feedback={doctor.feedback}
location={doctor.location}
doctor_fee={doctor.doctor_fee}
available_days={doctor.available_days}
available_timing={doctor.available_timing}
rating={doctor.rating_percentage}
votes={doctor.votes}
images={doctor.images}
/>
);
});
}}
/>
Doctors.js
const Doctors = (props) => (
....
....
<Route
path="/book-appointment"
exact
render={(props) => {
return <Appointment />;
}}
/>
....
....
)