3h Tonight I was up against a weird bug where I could only access an imported json object by hard-coding the elements I wanted. That wasn’t going to work for me, and I needed to find a better way. After I had spent 20 minutes writing it all out for a friend I finally tried something that helped me figure it out.
I also ran into a lot of infinite reload loops in react because I was inadvertently calling an onclick handler when I was assigning it. It seems odd, but your onclick handler has to not have any arguments passed in, and it shouldn’t be run in the assignment. When it is actually run (ie a click happens) a click event is given to it as an argument. Luckily I was able to use the className in the click event in order to do what I needed to do.