STRUCTURE - Where to store static data?
calumx opened this issue · comments
calumx commented
Sorry if this is covered in the docs, but I can't seem to find/work it out.
If I have a large, unchanging array of constants, where do I store this in the Bulletproof React structure? For example, a large list of options for a select menu that is used in several places throughout the app (so not appropriate to co-locate with the select component).
shobhitk8055 commented
The best way is to create a constants folder in src folder and there you create a file like options.ts.
interface OptionInterface {
[key: string]: string;
}
export const Options: OptionInterface = {
"male": "Male",
"female": "Female",
"other": "Other"
}