13. Composing Hooks to Solve Complex Problems
Activity 13.01: Creating a Recipe App
Solution:
- Start off by creating a new React app:
$ npx create-react-app recipes
- Go to the
src/App.js
file and deletelogo.svg
. Clear out the contents ofApp.js
andApp.css
. Instead, replace the contents ofsrc/App.css
with the following:.App {   display: flex;   justify-content: space-between; } .App > div {   padding: 20px; }
- Start off with an initial component in
src/App.js
:import React from "react"; import "./App.css"; const App = () => { Â Â return ( Â Â <div className="App"> Â Â </div> Â Â ); }; export default App;
- Create our left-hand side of the app, our
RecipeList
component, insrc/RecipeList.js
:import React from "react"; const RecipeList = () => { Â Â return ( Â Â <div className="RecipeList"> Â Â Â ...