I’m trying to run React lesson 9 in the Front End Development curriculum (Front End Development Libraries/React/ Create a Component with Composition). But for some reason, it does not compile and starts chugging ram. To be specific it takes up to 16GB of RAM while trying to compile. This is the only tab open in Firefox and I have no other things which are competing for RAM. Is this a server problem? or what could be the reason for this abnormal behaviour? I have just recently completed all lessons previous to this one without issues.
Something tells me you don’t want to create a ParentComponent from within the ParentComponent render function. Seems like you are just going to keep creating ParentComponents over and over again until you run out of memory or your browser feels sorry for you and mercifully stops the execution
To be a little more clear, when you create a ParentComponent it automatically calls the render function, so you can see that if you create a ParentComponent in the render function of the ParentComponent itself you have basically created a non-stop chain of creating ParentComponents because each render is going to create a new one.
I’m not a React expert so I might not have all the terminology above correct but I’m pretty sure that’s why you are running out of memory.