diff --git a/list.js b/list.js
index 156b82c..5c232e9 100644
--- a/list.js
+++ b/list.js
@@ -14,7 +14,10 @@ import { cycleDaysSortedbyTempValueView, saveTemperature } from './db'
export default class Temp extends Component {
constructor(props) {
super(props)
- this.state = { currentValue: '' }
+ this.state = {
+ currentValue: '',
+ rerenderToggle: false
+ }
}
render() {
@@ -38,13 +41,18 @@ export default class Temp extends Component {
}
)
this.setState({currentValue: ''})
+ // FlatList only reacts to primitive value changes,
+ // this boolean toggle makes sure the list updates
+ this.setState({ reRender: !this.state.rerenderToggle})
Keyboard.dismiss()
}}
title="Save"
/>
+ {cycleDaysSortedbyTempValueView.length}
{item.temperature.value}}
+ extraData = { this.state }
/>
)