In this Milestone, I performed the following actions;
- App Component
- App set as stateful parent component
- Initialize state in constructor with 3 properties;
- Total
- Next
- Operation
- Render function display the following component
- Display
- Button Panel
- Implement handle click function which takes button name as argument and changes state based on result of calculate function
- Pass the total or next value to Display to display the current result
- Pass handleClick as a clickHandler property to ButtonPanel
- Button Panel
- Implement the handleClick function which takes buttonName as an argument and returns clickHandler from props
- Pass the clickHandler property to each button in the panel
- Button
- Implement the handleClick function which takes buttonName as an argument and returns clickHandler from props
- Use the onClick event to attach the handleClick event to the button
- Fix linter errors with the following commands
npx stylelint "**/*.{css,scss}"
for stylelintnpx eslint .
for eslint
- Node.js
- React
- React-DOM
- React-Create-App
- npm
- React
- Heroku
heroku create $APP_NAME --buildpack mars/create-react-app
git push heroku Milestone-1:master
heroku open
To get a local copy up and running follow these simple example steps.
git clone https://github.com/addod19/calculator.git
cd calculator
git checkout start
yarn i
yarn start
This project was bootstrapped with Create React App.
- A modern browser
👤 Daniel Larbi Addo
- Github: @addod19
- Twitter: @DanielLarbiAdd1
- Linkedin: Daniel Larbi Addo
- Email: (addodaniellarbi@gmail.com)
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
- Fork it (https://github.com/addod19/calculator/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Give us a ⭐️ if you like this project!
- MIcroverse
- Microverse TSE's
This project is Apache licensed.