There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
Hi there, I’ve done some digging around and was able to replicate your error if I didn’t update the Header.js file with NavLinks to replace the a tags — specifically, if link that redirects to /profile is an a tag, it will cause the page to reload, thus losing the username that you had entered.
If you include NavLinks instead of a tags, you will get the desired behavior ONLY if you click on the profile button. Even if you have the proper NavLinks, if you were to enter your username and then manually navigate to /profile in the URL bar, you would lose the username. Why? Because this application is quite simple in the way it “signs users in”. Unlike more realistic sign-in features, this application simply stores the username in the browser’s memory which gets wiped when you refresh the browser which, as we learned, happens when you click on an <a> tag or if you navigate to a URL in the browser. In a more realistic application, when a user signs in, that data would be stored in some back-end service or in the browser’s cache (or something like that).
I’d like to add that, as someone who had the same problem, the reason I had not replaced the profile a with NavLink is because the comments in the file or the instructions on the module say to replace “the four a components” with navlinks. In reality there are 5 such components, so I made a best guess as to which one I was not (or not yet) supposed to replace, and chose not to replace the profile link. In reality it is fine and maybe necessary to replace every a in header.js with a NavLink.
I’ve been tripped up many times by errors such as this in Codecademy assignments.
When i click on edit then the edit form does not get rendered. It goes to blank page and profile name get disappeared.
Can someone please explain this to me? will be really appreciated