├── .eslintrc.js
├── .expo-shared
└── assets.json
├── .gitignore
├── App.jsx
├── app.json
├── assets
├── icon.png
└── splash.png
├── babel.config.js
├── package.json
├── src
└── FruitList.jsx
└── yarn.lock
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "env": {
3 | "browser": true,
4 | "es6": true
5 | },
6 | "extends": "airbnb",
7 | "globals": {
8 | "Atomics": "readonly",
9 | "SharedArrayBuffer": "readonly"
10 | },
11 | "parserOptions": {
12 | "ecmaFeatures": {
13 | "jsx": true
14 | },
15 | "ecmaVersion": 2018,
16 | "sourceType": "module"
17 | },
18 | "plugins": [
19 | "react"
20 | ],
21 | "rules": {
22 | "react/prop-types": "off",
23 | "react/forbid-prop-types": "off"
24 | }
25 | };
--------------------------------------------------------------------------------
/.expo-shared/assets.json:
--------------------------------------------------------------------------------
1 | {
2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4 | }
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/**/*
2 | .expo/*
3 | npm-debug.*
4 | *.jks
5 | *.p8
6 | *.p12
7 | *.key
8 | *.mobileprovision
9 | *.orig.*
10 | web-build/
11 | web-report/
12 |
13 | # macOS
14 | .DS_Store
15 |
--------------------------------------------------------------------------------
/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { StyleSheet, View } from 'react-native';
3 | import FruitList from './src/FruitList';
4 |
5 |
6 | const styles = StyleSheet.create({
7 | container: {
8 | flex: 1,
9 | backgroundColor: '#fff',
10 | },
11 | });
12 |
13 | export default function App() {
14 | return (
15 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "expo": {
3 | "name": "pulltorefreshtutorial",
4 | "slug": "pulltorefreshtutorial",
5 | "platforms": [
6 | "ios",
7 | "android",
8 | "web"
9 | ],
10 | "version": "1.0.0",
11 | "orientation": "portrait",
12 | "icon": "./assets/icon.png",
13 | "splash": {
14 | "image": "./assets/splash.png",
15 | "resizeMode": "contain",
16 | "backgroundColor": "#ffffff"
17 | },
18 | "updates": {
19 | "fallbackToCacheTimeout": 0
20 | },
21 | "assetBundlePatterns": [
22 | "**/*"
23 | ],
24 | "ios": {
25 | "supportsTablet": true
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Groftware/pulltorefreshtutorial/804ca40cbcf0abfcc6e4f822b492606a7f4e6e3f/assets/icon.png
--------------------------------------------------------------------------------
/assets/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Groftware/pulltorefreshtutorial/804ca40cbcf0abfcc6e4f822b492606a7f4e6e3f/assets/splash.png
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = function(api) {
2 | api.cache(true);
3 | return {
4 | presets: ['babel-preset-expo'],
5 | };
6 | };
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "node_modules/expo/AppEntry.js",
3 | "scripts": {
4 | "start": "expo start",
5 | "android": "expo start --android",
6 | "ios": "expo start --ios",
7 | "web": "expo start --web",
8 | "eject": "expo eject"
9 | },
10 | "dependencies": {
11 | "expo": "~37.0.3",
12 | "prop-types": "^15.7.2",
13 | "react": "~16.9.0",
14 | "react-dom": "~16.9.0",
15 | "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz"
16 | },
17 | "devDependencies": {
18 | "@babel/core": "^7.8.6",
19 | "babel-preset-expo": "~8.1.0",
20 | "eslint": "^6.8.0",
21 | "eslint-config-airbnb": "^18.1.0",
22 | "eslint-plugin-import": "^2.20.2",
23 | "eslint-plugin-jsx-a11y": "^6.2.3",
24 | "eslint-plugin-react": "^7.19.0",
25 | "eslint-plugin-react-hooks": "^2.5.1"
26 | },
27 | "private": true
28 | }
29 |
--------------------------------------------------------------------------------
/src/FruitList.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {
3 | View,
4 | FlatList,
5 | Text,
6 | StyleSheet,
7 | } from 'react-native';
8 |
9 | const fruits = [
10 | 'Apple',
11 | 'Orange',
12 | 'Watermelon',
13 | 'Avocado',
14 | 'Blueberry',
15 | 'Coconut',
16 | 'Durian',
17 | 'Mango',
18 | ];
19 |
20 | const styles = StyleSheet.create({
21 | flatlist: {
22 |
23 | },
24 | row: {
25 | height: 100,
26 | justifyContent: 'center',
27 | padding: 20,
28 | borderBottomWidth: 3,
29 | borderBottomColor: 'black',
30 | },
31 | rowTitle: {
32 | fontSize: 30,
33 | fontWeight: 'bold',
34 | },
35 | });
36 |
37 | function FruitList() {
38 | function renderItem({ item }) {
39 | return (
40 |
41 | {item}
42 |
43 | );
44 | }
45 |
46 | return (
47 |
57 | );
58 | }
59 |
60 | export default FruitList;
61 |
--------------------------------------------------------------------------------