Hello I have been stuck on the Redux News Reader project in the Learn Redux portion of the full-stack engineer path for a week now. In this project, unlike others it seems that I am not provided with a terminal and I feel like I could figure out my issues if I could test parts of the project by logging to the console. Is there some way to access the terminal that I am unaware of?
I also struggled with this project a lot, because it did not compile what I had edited correctly for quite some time despite clicking save several times. I had to wait until the next day to see all my changes displayed.
Unfortunately there is no download option for this project as there is with other React projects. Maybe that’s because Codecademy uses a fake DB for the articles as they mention in the project introduction. But I saw the articles hardcoded in on of the folders. So it would be really helpful if that could be added some time.
You can still use the browser’s console, but you have to ignore some potential messages that aren’t related to your work but the Codecademy environment. Or you install React with Redux independently, copy file by file and install dependencies if needed. I haven’t tried that though.
That was actually what I meant when I wrongly typed ‘download all the files’ (although I haven’t yet gone into Redux, so I still haven’t had to deal with that), but so far at least with CRA, what I do is I have a specific folder in my computer where I npx create-react-app my_CC_project and then open that folder in VSC with cd my_cc_project and then code . which should open that folder in Code.
Then, like you said in the last part of your message, I patiently copy the relevant files (or lines, for example, in the case of index.html) and I delete the test files, css (after I copied styles.css into a styles.css in the public folder and link it from index.html), and a few files that I won’t need, and then work there.
I know, this takes a few more minutes of setup, but like you both commented and I agree, there are things like the console, React Dev Tools, etc. that work way more conveniently for debugging. Well, at least I give my two cents, because sincerely this works for me, but maybe not for everyone. Just in case it helps.
Additional note: If you have Redux, I was looking around and maybe you can use their template for CRA, creating the app instead with npx create-react-app my-cc-project --template redux. (Although I haven’t tested this yet, I confess).
Hey Jon, I was able to complete the part where you can fetch the comments from the API and render them on the articles. The problem was that some articles didn’t have comments, that’s why no comments were displayed. An article with Kamala Harris was one of the articles that had comments.
Here is my solution about the first part, hopefully I was able to help you. Thanks for responding
Hey Jon I tried to reply with the solution but I think it’s against the guidelines. For me the problem was that some articles didn’t have comments, that’s why nothing was being displayed. The Kamala Harris Article has comments so you should be able to see them after you complete the tasks.
Thanks for this. Have been staring at the code in a dissociated state for hours. For any future readers: if using a brace (as the OP and myself did), you need to Return your desired result. If you use the bracket, then you don’t need to include Return. i.e. the return must be explicit when using a block (braces):
@grishabezshaposhniko I was stuck on the same thing because they didn’t explain how to get the comments from the action.payload in the steps. They did mention that the payload had an articleId property though.
Hey everyone. Not sure if this will help any of you, but this project was very frustrating to me. I had problems both with loading the comments, and then getting mine to post. I went so far as to copy my code into VSCode and side-by-side compare it with some code I found here and elsewhere, and found that mine pretty much was the same.
I finally got it to work by cutting my code, replacing it with gibberish, and then re-pasting my code back into the editor. I did this on all the files. Don’t ask me what thought process let me to that, but when my code went back in EXACTLY AS IT WAS BEFORE, it worked. I don’t know why or how. I even tried Firefox and Chrome, and got the same result. So, if your code is correct, try something like I did to drastically change what you’re saving, and then re-paste. It may just work!
Greetings all. Was just wondering if anybody was having trouble with the articles showing. This project states in the project description
" Currently, the app fetches and displays a list of all articles in their preview form. It also fetches and displays the current article, which can be selected and changed by the user."
I am at step 7 and I have not seen a single article appear. (Makes it challenging to find a space for comments per article, when I cannot even see the article). Anybody else having this issue? Or do I just need to continue through and the articles will reveal themselves as I add props to components???
It seems like the mock API is not even being accessed appropriately. But its hard to say.