Changes to create-react-app have broken the Ravenous Part 3 Instructions

Hi all, I’m working on Ravenous Part 3, a lesson in the React.js module. Link:
https://www.codecademy.com/paths/web-development/tracks/front-end-applications-with-react/modules/ravenous-part-three/projects/setting-searchbar-state

In step 16, the instructions ask the user to include a method called ‘searchYelp()’ under the App class declaration, in the App.js file.

The latest version of create-react-app has modified the template of App.js so that he App class declaration is now a function. See the before and after:

APP.JS in previous create-react-app version

class App extends React.Component {
  render () {
    return (
    <div className="App">
      <h1>ravenous</h1>
      <SearchBar searchYelp={searchYelp('pizza', 'new york', 'best_match')} />
      <BusinessList businesses={businesses} />
    </div>
    )
  }
};

export default App;

APP.JS in latest create-react-app version

function App() {
  return (
    <div className="App">
      <h1>ravenous</h1>
      <SearchBar searchYelp={searchYelp('pizza', 'new york', 'best_match')} />
      <BusinessList businesses={businesses} />
    </div>
  );
}

export default App;

Trying to add the searchYelp() method to the App function declaration breaks the compiler, so I’m not sure how to include it and progress with the lesson.

Any ideas?

2 Likes

I’ve figured it out. Manually changing the App function declaration to an App class declaration will fix the problem. Would be good if Codecademy could update the instructions to reflect this though…

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.