Added a catch all route in server.js file at the end of all server routes to give unmatched routes to react router to handle and serve.
Added userLoading condition in Edit component because on page refreshing initial value of user was null in auth context and the useEffect hook was redirecting to / in case of !user.
Changes
server.js
file at the end of all server routes to give unmatched routes to react router to handle and serve./
in case of!user
.