8000 GitHub - alexisintech/calculator: Simple calculator app created with React.js, fully utilizing useReducer hook for updating state
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Simple calculator app created with React.js, fully utilizing useReducer hook for updating state

Notifications You must be signed in to change notification settings

alexisintech/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪐 React Calculator

Calculator App built with React.js for practicing functional components, state, reducer, and props.

Netlify Status

⭐ Features

  • Standard calculator functionality (addition, subtraction, division, multiplication) with floating point calculations supported
  • Use the DEL button to delete an integer or clear the input field if there is a single integer
  • Use the AC button to clear the input field
  • Allows operation chaining until the equal (=) sign is clicked, setting the input field to be the final solution of the calculations
  • Integer formatting: comma's are added to proper placement in larger integers, multiple zero's cannot be placed on an empty input field, numbers cannot be prefixed with zero's unnecessarily but can have zero's following a decimal

🛠️ Built With

  • React.js, Webpack, Babel
  • HTML5/CSS3, Javascript ES6
  • ESlint, Stylelint
  • VSCode

🌠 Get your own copy running!

  • Clone using your preferred method
  • npm i
  • npm start

The page will reload if you make edits.
You will also see any lint errors in the console.

🌝 Tea Spill

Creating this calculator was SUPER fun because it was my first time using useReducer. It was challenging to figure out that I could pass the dispatch through props of components, and how to pass the payload through calling that dispatch in the component. The HARDEST part of this project was the logic of the calculator, for example, thinking about edge cases such as handling when someone presses multiple 0's, they shouldn't appear on the screen because a standard calculator will only allow you to enter one zero if that's the only integer on the screen. I watched a tutorial to make sure I was catching the most common edge cases.

About

Simple calculator app created with React.js, fully utilizing useReducer hook for updating state

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0