Hey guys
I cannot render anything using react, and I cannot figure out why.
Help me out please.
Hey guys
I cannot render anything using react, and I cannot figure out why.
Help me out please.
Wow - this is a tough oneā¦I canāt find it either Itās not making sense to me why itās not renderingā¦
The only thing I came up with (that may or may not be the issue) is in your RecipeBox component, the āclassā attributes should be āclassNameā for React. I see you have it correctly on your other components, so Iām sure its just a simple mistake
I had this happen to me once and I couldnāt find an error either, so I ended up creating a new pen and carefully copying and pasting pieces of code over to a new pen. I never found what was causing the errorā¦
One other tip, add this to the top of your javascript, so when you run JSHint, it will recognize it as ES6.
// jshint esversion: 6
Hope this works out for youā¦Iām sorry I couldnāt be of more help
I have a react codepen template, so I opened that and copy/pasted all your code, and got this far:
Iāll let you debug the rest. The only change I made was to replace the inner contents of your ingredientLIst map. Iām not sure why itās not spitting out the ingredients because itās getting the correct props. I used the world"test" and itās printing those with the recipe just fine.
Then I retyped by hand the inner code with the div, paragraph and closing div tag.
I honestly donāt know how or why itās any different than yours. No editing other than retyping the same code. Are you cutting and pasting from another editor that could be adding in some weird chars?
Quick check in Chrome Developer Tool console says that the reactDOM doesnāt have a render method, which sounds crazy town until I check your external imports
You were using https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js, which if you click the link, youāll find that itās not really react-dom at all
Deleted that reference, quick add the default react-dom, and everything works perfectly. Well, not sure about perfectly, but things render nice and pretty
I got a different āundefinedā error when I used console on his original pen. Good detective work!