i am trying to do the ravenous project (this is not authorization-form project but i couldn’t find the ravenous project in the subtitles) part 2 and i get the following error message:
If it runs, then they’re not exactly the same.
Normally if you want to compare two files or even directories, you would tell a program named diff (most environments that have bash probably also have this program) about them both, diff would then read them both and report any differences - if a single byte is different, it will be found - that’s probably not how you compared when you are saying they’re exactly the same. But that is how you need to be comparing to say that.
Or if they are identical, are the other files identical too?
Or if the solution code doesn’t run either then the problem might be something else entirely, one might then start asking questions like whether it should run at all.
It can sometimes be a really good idea to run a project before writing any code. What should it do when there’s nothing there, did it successfully compile and all that? And then one might add small parts at a time, running after each change and comparing the outcome to expectations.
I suggest commenting out everything in the component so that it’s just an empty component. Run it. Does it run? If yes, start adding things back.
And if it doesn’t run when it’s just an empty component then that still tells you something - that you’d need to look elsewhere.
And then change your code gradually instead, and run it after each change so that you are interacting with it rather than writing lots of code and then things are wrong and you don’t know what to do.
App should be a class. Like the other classes, it should also extend React.Component, and have a render() method. There is also supposed to be a <h1></h1> element inside the <div></div> above the <SearchBar /> component. (The <h1></h1> element won’t cause a problem. It just won’t appear like it does in the examples.)
I’m feeling ignored. I’ll say it a third time anyway. Because this is still the way to find it.
Problem: your method tries to get a property from null
Proposed strategy for finding where: make your method do nothing, and then slowly add things back
ok, i am so sorry for that question, i think it was a typing error i typed biusness instead of business.
thanks you for the advice! i will do this the next time before i ask the question.
Better yet, do it regardless of whether things are wrong.
Run the code. Make a change. Run it again. Still ok? Did the change have the desired effect?
You’ll know immediately when and where you make a mistake, and it’s good to see the effect of each thing you write as well.
It also gets you into the habit of observing what happens in your code.
Of course, when you’re more familiar with something there might not be any information that you need to obtain and you’d just keep typing and if something went wrong then you’d be in such control over it that you’d be able to debug it quickly regardless of how large it is.