This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this code on your app.js | |
import SQLite from 'react-native-sqlite-storage'; | |
global.db = SQLite.openDatabase( | |
{ | |
name: 'SQLite', | |
location: 'default', | |
createFromLocation: '~SQLite.db', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SQLite from 'react-native-sqlite-storage'; | |
export default class SQLiteScreen extends React.Component { | |
constructor() { | |
super(); | |
SQLite.DEBUG = true; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SQLite from 'react-native-sqlite-storage'; | |
export default class SQLiteScreen extends React.Component { | |
constructor() { | |
super(); | |
SQLite.DEBUG = true; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SQLite from 'react-native-sqlite-storage'; | |
export default class SQLiteScreen extends React.Component { | |
constructor() { | |
super(); | |
SQLite.DEBUG = true; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SQLite from 'react-native-sqlite-storage'; | |
export default class SQLiteScreen extends React.Component { | |
constructor() { | |
super(); | |
SQLite.DEBUG = true; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SQLite from 'react-native-sqlite-storage'; | |
export default class SQLiteScreen extends React.Component { | |
constructor() { | |
super(); | |
SQLite.DEBUG = true; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SQLite from 'react-native-sqlite-storage'; | |
export default class SQLiteScreen extends React.Component { | |
constructor() { | |
super(); | |
SQLite.DEBUG = true; | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ScrollView | |
showsVerticalScrollIndicator={false} | |
// define ref | |
ref={ref => (this.ScrollView = ref)} | |
// use for store scrolled value | |
onScroll={event => | |
this.setState({horizontalScroll:event.nativeEvent.contentOffset.x, VerticalScroll:event.nativeEvent.contentOffset.y}) | |
} | |
> | |
// Your list data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// auto scroll function | |
autosScroll(){ | |
// X use for horizontal | |
let horizontalScroll = this.state.horizontalScroll; | |
// Y use for Vertical | |
let VerticalScroll = this.state.VerticalScroll; | |
this.ScrollView.scrollTo({x: horizontalScroll, y: VerticalScroll, animated: true}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.ScrollView = React.createRef(); | |
} | |
} |
OlderNewer