15. Promise API and async/await
Activity 15.01: Creating a Movie App
Solution
- Install
create-react-app
for the project namedsearch-movies
. - In the
src
folder, remove all the existing files. Once they are removed, create a new file called index.js and add the following code. It will import the<App>
component and render it in HTML:import React from 'react'; import ReactDOM from 'react-dom'; import App from './components/App'; ReactDOM.render(<App />, document.querySelector('#root'));
- Still in the
src
folder, create a folder called components and create a file calledApp.js
inside the component folder. Once this is done, add some boilerplate for the<App>
component:import React from 'react'; const App = () => { return( <div className="page"> <h1>5 Most Popular Movies Now</h1> </div> ...