I was working on displaying multiple GitHub traffic charts using a Google Chart NPM package for React, react-google-charts.
Out of many charts, only the first one chart is populated.
How do we fix it?
I was implementing a trie, which is a tree data structure, usually for storing strings for searching. Since it’s a tree, it has a “Children” for holding child nodes.
But then I ran into a problem where simply calls to adding children to a collection (Line# 9) didn’t work.
After 30 minutes of debugging, I was like…
Just what the h**l happened?
Initially, the API key is stored in a file, which is untracked by Git. It was fine until when I found out that Heroku requires files to be published to be tracked by Git.
I didn’t want to expose my secret string to GitHub, which is very easily searchable as Jamie Taylor points out in his blog post, User Secrets – What Are They And Why Do I Need Them? (Jamie talks about how to use User Secrets, please refer to it if you are dealing with .NET Core).
So the alternative is to use an environment variable and make it available on Heroku.
OK, you are working on a side programming project, and it’s not progressing.
Probably you aren’t the only one. I’ve been working on a side project using React and ran into a problem.
This is just one of the many ways of that will help you to advance your project.
TLDL; Exercise often with “Throwaway” code.