bug fix with onmount and AsyncStorage with history state
|
|
@ -37,8 +37,10 @@ export default function App() {
|
||||||
|
|
||||||
const grabPersistence = async () =>{
|
const grabPersistence = async () =>{
|
||||||
const persistentData:any = await AsyncStorage.getItem('history')
|
const persistentData:any = await AsyncStorage.getItem('history')
|
||||||
|
if (persistentData){
|
||||||
setHistory(JSON.parse(persistentData))
|
setHistory(JSON.parse(persistentData))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(()=>{calcResale(cost,percent)},[cost,percent])
|
useEffect(()=>{calcResale(cost,percent)},[cost,percent])
|
||||||
useEffect(()=>{grabPersistence()},[])
|
useEffect(()=>{grabPersistence()},[])
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
|
@ -9,8 +9,11 @@
|
||||||
"web": "expo start --web"
|
"web": "expo start --web"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-native-async-storage/async-storage": "^1.18.1",
|
"@expo/config-plugins": "~6.0.0",
|
||||||
|
"@react-native-async-storage/async-storage": "1.17.11",
|
||||||
|
"eas-cli": "^3.13.0",
|
||||||
"expo": "~48.0.15",
|
"expo": "~48.0.15",
|
||||||
|
"expo-doctor": "1.0.6",
|
||||||
"expo-status-bar": "~1.4.4",
|
"expo-status-bar": "~1.4.4",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-native": "0.71.8",
|
"react-native": "0.71.8",
|
||||||
|
|
@ -21,6 +24,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.0",
|
"@babel/core": "^7.20.0",
|
||||||
"@types/react": "~18.0.14",
|
"@types/react": "~18.0.14",
|
||||||
|
"@types/react-native": "^0.72.0",
|
||||||
"typescript": "^4.9.4"
|
"typescript": "^4.9.4"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
|
|
|
||||||