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-2 shows the dialog that pops up when the user clicks the + ADD WHINE button.
Figure 8-3 shows the state of the app after the user has added one more row.
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 ...
Get React: Up & Running, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.