Example
Current Code:
<Route path="/products" element={<AddNewProductPage1 />} />
<Route path="/login" element={<Login />} />
<Route path="/create-account" element={<CreateAccount />} />
<Route path="/email-verification" element={<EmailVerify />} />
<Route path="/phone-verification" element={<PhoneNumberVerification/>} />
Suggested change?
import {PRODUCTS, LOGIN, CREATEACCOUNT, EMAILVERIFICATION} from "../../routeConstants.js"
<Route path={`/${PRODUCTS}`} element={<AddNewProductPage1 />} />
<Route path={`/${LOGIN}`} element={<Login />} />
<Route path={`/${CREATEACCOUNT}`} element={<CreateAccount />} />
<Route path={`/${EMAILVERIFICATION}`} element={<EmailVerify />} />
All route constants can be declared in one file, and exported to be used anywhere in the app. Every contributor can access that file as a point of contact instead of wondering what the spelling of route paths are.