My learning diary

Some Similarities

This .some-class { display: flex; flex-direction: column; justify-content: center; min-height: 20rem; } and this .some-class { display: flex; align-items: center; min-height: 20rem; } appear the same to me. CSS-Tricks says, You can think of align-items as the justify-content version for the cross-axis (perpendicular to the main-axis).

Continue reading "Some Similarities"

Redux Poof!

I was at Page A. Page A calls an API and stores the response in the Redux store. After some clicking, I was routed to Page B. I expected to retrieve the API response stored by Page A. But it wasn’t there! The culprit was <a href ...>. I should be using Link or navigate(...) instead. When I refreshed Page B after getting there via Link, the store went poof again.

Continue reading "Redux Poof!"

Center

Why “Center” instead of “Centre”? Well, that’s because “center” is the version used in CSS. There were moments in my life when I wanted to give up writing in British English. There are so many other people using American English… except for me. Programming languages are expressed using American English as well. I felt like a rebel for naming my variables in British English, but that’s what I’ve learnt in school.

Continue reading "Center"

Javascript heap limit

For the past week, I could not fathom why my diffs seemed to not be on hot reload. It turned out to be a JavaScript heap limit problem. As a result, the codebase did not rebuild and remained stale. This issue does not happen to everyone. I am using a MacBook Air (13-inch, 2017) with 8 GB of RAM. Notice the line above the last which says, FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory.

Continue reading "Javascript heap limit"