- Build, Configure & Combine Components
- Manage Application State
- Output List & Conditional Content
- Use the starting project attached to the first lecture
- Add components for displaying a header, fetching user input & outputting the results table
- Fetch & store user input (i.e. the entered investment parameters)
- Derive investment results with help of the provided utility function (in the starting project)
- Display investment results in a HTML table (use
<table>
,<thead>
,<tbody>
,<tr>
,<th>
,<td>
) - Conditionally display an info message if an invalid duration (<1) was entered
- Run "npm install"
- Run "npm run dev"
- Create README.md
- Create Header Component
- Import Header Component into App.jsx
- Create UserInput Component
- Import UserInput Component into App.jsx
- Get hold of the Value Entered by the User with UseState()
- Reflect that Value Back into the Input Field with the value attribute
- Lift the
userInput
State Up from the UserInput Component to the App Component - Pass
onChange
&userInput
as props in UserInput Component to Get the Object from the State & use thehandleChange
function - Create the Results Component
- Pass also the
userInput
as props in the Results Component - Output the Results Component
- Derive the Results Data in the Results Component
- Import & use the
calculateInvestmentResults
function fromutil/investment.js
- Compute Values based on the
input
state
- Import & use the
- Convert the
newValue
into a number
- Output results data in a table dynamically as a list based on the
resultsData
array - Use
formatter.format()
to make numbers prettier
- Conditionally display an info message if an invalid duration (<1) was entered
- Derive the information whether the input is valid or not based on this
userInput
state in a constantinputIsValid
- Make sure that the
Results
component is output conditionally (it should only be output if we have valid user input) - Show a fallback message if the input should not be valid
- Derive the information whether the input is valid or not based on this