I keep getting the below error when trying to run the ravenous part 4 code. I’ve triple checked my js code against the ‘solution code’ and everything matches. Any help please!!!???
Without seeing your code in full I think we might still be able to help based on the error message.
I’m still early into learning too and I’ve found a great way to find answers and solutions is to simply google error messages. If you look this one up you’ll find that the map method is expecting to be called on an array. The way it has responded means that this.props.businesses is not an array and has not even been defined.
Check the chain that passes the props, it would seem something is wrong there. Without seeing your code I can’t tell but are you sure you need to be using
this.props and not
App component is the ultimate parent and contains the
businesses as part of it’s state.
App renders the
BusinessList component, passing
businesses down as a prop.
One suspect ruled out then!
That mix up has tripped me up a few times in the past so thought it was worth a shot in the dark.
I was having the same error as well. At first I discovered this error and realised I had forgotten to change a few class to className in my SearchBar
But ultimately my error came down to this:
I have spent the better part of 90 minutes trying to figure out what was wrong with that code. Reading all the posts from people who had the same issue. Re-watching the video walkthrough to see if mine added up. Ending up opening the solution code and and reading the two side by side.
Turns out I’d put
Ninty minutes of my life wasted on a rogue ‘s’.
Check for the smallest of typos. It could be that.
I believe the OP fixed the issue, as they posted about it on another existing topic as well: