These are personal observations I keep for myself
Name your files like-this.file
or likeThis
.file, dashes allow you to delete one word at a time, camelCase allows IDE snippets to automatically scaffold the name.
- Always prefix your
console.logs
so that you can find rogue logs easily. - Use
console.error
for errors, duh. - If you want to keep a
console
statement permanently, useconsole.info
orconsole.warn
Think about how you plan to use your data.
- Do you need it for SEO? Then static and/or server render it
- Does it depend on user interaction, like a date range for a graph? Probably client-side, you can componentize or use in
useEffect
- Does it need to be refreshed? In realtime, Then you may want SWR. If on page load, use revalidation.