Part 1 of probably many.

So, it’s Monday, and I officially began work on re-factoring how my Fact Review page works in my BrainReps webapp.

I have a very basic progress bar that renders based on the number of facts being reviewed (woo!) but doesn’t track progress. Although I think I could probably knock that out in a half hour if given a chance. I have an idea of what to do.

What I also have — and what I’m stuck on — is a list of facts. Rather than the current fact being reviewed.

Yes, it bothers me that that’s not centered. Yes, I am completely over messing with formatting today.

Back to the problem at hand: I would love to render a single fact at a time but (insert very whiny voice here) I can’ttttt. And even worse: I don’t know what to doooooo.

Here’s what the FactsForReview component does right now: it makes an API call using useEffect (which I’ve been told is wrong, and I think is the source of my woes, more on that in a second) and sets my facts as a state array of fact objects. (I don’t know if these are the right words. I am green.) The array is then mapped into individual ReviewFact components. Et voila. A page full of facts.

I (mistakenly) thought it would be fairly simple to just render a single ReviewFact, using the facts array and the index of the fact I want to pull for review. BUT APPARENTLY THAT’S NOT THE CASE.

If I worked at a company, this is the point where I would reach out to my peers/mentors and be straightened out on how to fix my probably very silly and easy-to-solve problem. But I don’t work at a company. So I have to fix this on my own.

For now, I’m putting it away for the night. Tomorrow I might go to YouTube and see if there are any similar tutorials. I don’t know. I’ll get it worked out, somehow!

2

mins
read

Begin typing your search above and press return to search. Press Esc to cancel.