replace require with import

This commit is contained in:
tina
2018-05-29 13:37:30 +02:00
parent a43a5fd96e
commit 2f443c7743
3 changed files with 1811 additions and 1806 deletions
+4 -2
View File
@@ -6,9 +6,10 @@ import {
TextInput,
FlatList
} from 'react-native'
console.log('first hi')
import * as styles from './styles'
import Datastore from 'react-native-local-mongodb'
const styles = require('./styles')
const Datastore = require('react-native-local-mongodb')
const db = new Datastore({ filename: 'asyncStorageKey', autoload: true })
export default class drip extends Component {
@@ -17,6 +18,7 @@ export default class drip extends Component {
this.state = {
temperatures: []
}
console.log('hello')
db.find({ key: { $exists: true } }, (err, persistedTemperatures) => {
if (err) throw err
this.setState({
+1802 -1802
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -1,5 +1,6 @@
const StyleSheet = require('react-native').StyleSheet
module.exports = StyleSheet.create({
import { StyleSheet } from 'react-native'
const ourStyle = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
@@ -11,3 +12,5 @@ module.exports = StyleSheet.create({
margin: 10,
}
})
export { ourStyle }