A simple calculator app written with React Native and Expo. The project used for educational purposes in React Native from scratch course in K.N. Toosi university of technology.
Write a component called Caclulator
which contains the whole caluclator module. Use it in CalculatorScreen
and add additional props if you like. The desired code for CalculatorScreen
would be as described bellow:
import { Calculator } from '../components';
export default class CalculatorScreen extends React.Component{
render(){
return(
<Calculator />
);
}
}
- Write
Calculator
in/src/components/Calculator.js
- Export
Calculaor
in/src/components/index.js
- Try to compute simple inputs such as
2+2
and etc.
- Add additional props such as
mode
toCalculator
- Use complex mathematical expressions
- Simple caculator using basic React Native components
- Using our own written custom component for Button
- Write more custom componets and break the code into small parts
-
First clone the repository
git clone https://github.com/triplea24/kntu-react-native-calculator.git
-
Then change directory to the project
cd kntu-react-native-calculator
-
Install node packages
yarn (install)
or
npm install
-
Run the project
expo start