Chapter 8. The Finished App
All the components of the new app are done and testable in the discovery tool (http://localhost:3000/discovery). Now it’s time to put them all together into a working application (available in the browser as http://localhost:3000/). Figure 8-1 shows the desired result when the user loads the app for the first time. There is a single row of default data coming from schema’s samples to demonstrate the purpose of the app to the user.
Figure 8-1. Loading the finished app for the first time
Figure 8-2 shows the dialog that pops up when the user clicks the + ADD WHINE button.
Figure 8-2. Adding a new record
Figure 8-3 shows the state of the app after the user has added one more row.
Figure 8-3. Two records in the table
Since you already have the header, body, the table component Excel, and the dialog component, the rendering is merely a question of assembling them, like so:
<div><Header/><Body><Excel/><Dialog><Form/></Dialog></Body></div>
Then the main task is providing the correct props to these components and taking care of the data flow between them. Let’s create a component called DataFlow to take care of all this. DataFlow should have all ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access