So I reached ravenous part 3 and stumbled upon this on step 16:
" In App.js , add a method called searchYelp()
in the class declaration of the App
component. (Place it above the render()
method.)"
When I went to app.js in my project I noticed my code looks like this:
function App() {
return (
<div className="App">
<h1>ravenous</h1>
<SearchBar />
<BusinessList businesses={businesses} />
</div>
);
}
So I notice there’s no app class declaration and I went back to all the previous steps to see if I was asked to do that but I wasn’t, in fact it appears that the codecademy lessons expected my code to look like this since I initiated my react app from the beginning:
class App extends React.Component {
render() {
return (
<div className="App">
<h1>ravenous</h1>
<SearchBar />
<BusinessList />
</div>
);
}
}
So I’m thinking react has had some kind of version change where app is created as a function declaration instead of a class declaration but I’m not entirely sure (i’ve stumbled upon another issue where when you write super(props) super is “deprecated” and apparently is due to some recent change in react). I would like to know if in fact this is the case and if so then please be aware of this issue.
Best regards.