38 |
39 | ## 🛠 Installation and Usage
40 |
41 | Please check the complete docs at https://getstream.github.io/react-native-bidirectional-infinite-scroll/
42 |
43 | ## ✍ Contributing
44 |
45 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
46 |
47 | ## 🎗 License
48 |
49 | MIT
50 |
--------------------------------------------------------------------------------
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | executors:
4 | default:
5 | docker:
6 | - image: circleci/node:10
7 | working_directory: ~/project
8 |
9 | commands:
10 | attach_project:
11 | steps:
12 | - attach_workspace:
13 | at: ~/project
14 |
15 | jobs:
16 | install-dependencies:
17 | executor: default
18 | steps:
19 | - checkout
20 | - attach_project
21 | - restore_cache:
22 | keys:
23 | - dependencies-{{ checksum "package.json" }}
24 | - dependencies-
25 | - restore_cache:
26 | keys:
27 | - dependencies-example-{{ checksum "example/package.json" }}
28 | - dependencies-example-
29 | - run:
30 | name: Install dependencies
31 | command: |
32 | yarn install --cwd example --frozen-lockfile
33 | yarn install --frozen-lockfile
34 | - save_cache:
35 | key: dependencies-{{ checksum "package.json" }}
36 | paths: node_modules
37 | - save_cache:
38 | key: dependencies-example-{{ checksum "example/package.json" }}
39 | paths: example/node_modules
40 | - persist_to_workspace:
41 | root: .
42 | paths: .
43 |
44 | lint:
45 | executor: default
46 | steps:
47 | - attach_project
48 | - run:
49 | name: Lint files
50 | command: |
51 | yarn lint
52 |
53 | typescript:
54 | executor: default
55 | steps:
56 | - attach_project
57 | - run:
58 | name: Typecheck files
59 | command: |
60 | yarn typescript
61 |
62 | unit-tests:
63 | executor: default
64 | steps:
65 | - attach_project
66 | - run:
67 | name: Run unit tests
68 | command: |
69 | yarn test --coverage
70 | - store_artifacts:
71 | path: coverage
72 | destination: coverage
73 |
74 | build-package:
75 | executor: default
76 | steps:
77 | - attach_project
78 | - run:
79 | name: Build package
80 | command: |
81 | yarn prepare
82 |
83 | workflows:
84 | build-and-test:
85 | jobs:
86 | - install-dependencies
87 | - lint:
88 | requires:
89 | - install-dependencies
90 | - typescript:
91 | requires:
92 | - install-dependencies
93 | - unit-tests:
94 | requires:
95 | - install-dependencies
96 | - build-package:
97 | requires:
98 | - install-dependencies
99 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalInfiniteScrollExample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 | #import
13 |
14 | #ifdef FB_SONARKIT_ENABLED
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 | #import
21 | static void InitializeFlipper(UIApplication *application) {
22 | FlipperClient *client = [FlipperClient sharedClient];
23 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
24 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
25 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
26 | [client addPlugin:[FlipperKitReactPlugin new]];
27 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
28 | [client start];
29 | }
30 | #endif
31 |
32 | @implementation AppDelegate
33 |
34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
35 | {
36 | #ifdef FB_SONARKIT_ENABLED
37 | InitializeFlipper(application);
38 | #endif
39 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
40 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
41 | moduleName:@"BidirectionalInfiniteScrollExample"
42 | initialProperties:nil];
43 |
44 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
45 |
46 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
47 | UIViewController *rootViewController = [UIViewController new];
48 | rootViewController.view = rootView;
49 | self.window.rootViewController = rootViewController;
50 | [self.window makeKeyAndVisible];
51 | return YES;
52 | }
53 |
54 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
55 | {
56 | #if DEBUG
57 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
58 | #else
59 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
60 | #endif
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativebidirectionalinfinitescroll/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativebidirectionalinfinitescroll;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.ReactInstanceManager;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 |
14 | public class MainApplication extends Application implements ReactApplication {
15 |
16 | private final ReactNativeHost mReactNativeHost =
17 | new ReactNativeHost(this) {
18 | @Override
19 | public boolean getUseDeveloperSupport() {
20 | return BuildConfig.DEBUG;
21 | }
22 |
23 | @Override
24 | protected List getPackages() {
25 | @SuppressWarnings("UnnecessaryLocalVariable")
26 | List packages = new PackageList(this).getPackages();
27 | // Packages that cannot be autolinked yet can be added manually here, for BidirectionalInfiniteScrollExample:
28 | // packages.add(new MyReactNativePackage());
29 |
30 | return packages;
31 | }
32 |
33 | @Override
34 | protected String getJSMainModuleName() {
35 | return "index";
36 | }
37 | };
38 |
39 | @Override
40 | public ReactNativeHost getReactNativeHost() {
41 | return mReactNativeHost;
42 | }
43 |
44 | @Override
45 | public void onCreate() {
46 | super.onCreate();
47 | SoLoader.init(this, /* native exopackage */ false);
48 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled
49 | }
50 |
51 | /**
52 | * Loads Flipper in React Native templates.
53 | *
54 | * @param context
55 | */
56 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
57 | if (BuildConfig.DEBUG) {
58 | try {
59 | /*
60 | We use reflection here to pick up the class that initializes Flipper,
61 | since Flipper library is not available in release mode
62 | */
63 | Class> aClass = Class.forName("com.reactnativebidirectionalinfinitescrollExample.ReactNativeFlipper");
64 | aClass
65 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
66 | .invoke(null, context, reactInstanceManager);
67 | } catch (ClassNotFoundException e) {
68 | e.printStackTrace();
69 | } catch (NoSuchMethodException e) {
70 | e.printStackTrace();
71 | } catch (IllegalAccessException e) {
72 | e.printStackTrace();
73 | } catch (InvocationTargetException e) {
74 | e.printStackTrace();
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/website/docs/how-it-works.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: How it works
3 | slug: /how-it-works
4 | ---
5 |
6 | This section will walk you through the hurdles of implementing bidirectional infinite scroll and how its solved by this package.
7 |
8 | ### Support for `onStartReached`
9 | [FlatList](https://reactnative.dev/docs/flatlist) from React Native has built-in support for infinite scroll in a single direction (from the end of the list). You can add a prop `onEndReached`on `FlatList`. This function gets called when your scroll is near the end of the list, and thus you can append more items to the list from this function. You can Google for **React Native infinite scrolling**, and you will find plenty of examples for this. Unfortunately, the `FlatList` doesn't provide any similar prop for `onStartReached` for infinite scrolling in other directions.
10 |
11 | We have added support for this prop as part of this package by simply adding the `onScroll` handler on `FlatList`, and executing the callback function (`onStartReached`) when the scroll is near the start of the list. If you take a look at the implementation of [VirtualizedList](https://github.com/facebook/react-native/blob/master/Libraries/Lists/VirtualizedList.js), you will notice that `onEndReached`function gets called only once per content length. That's there for a good purpose - to avoid redundant function calls on every scroll position change. Similar optimizations have been done for `onStartReached` within this package.
12 |
13 | ### Race condition between `onStartReached` and `onEndReached`
14 |
15 | To maintain a smooth scrolling experience, we need to manage the execution order of `onStartReached` and `onEndReached`. Because if both the callbacks happen at (almost) the same time, which means items will be added to the list from both directions. This may result in scroll jump, and that's not a good user experience. Thus it's essential to make sure one callback waits for the other callback to finish.
16 |
17 | ### `onStartReachedThreshold` and `onEndReachedThreshold`
18 |
19 | `FlatList` from React Native has a support for the prop `onEndReachedThreshold`, which is [documented here](https://reactnative.dev/docs/flatlist#onendreachedthreshold)
20 |
21 | > How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the `onEndReached` callback.
22 |
23 |
24 | Instead, it's easier to have a fixed value offset (distance from the end of the list) to trigger one of these callbacks. Thus we can maintain these two values within our implementation. So `onStartReachedThreshold` and `onEndReachedThreshold` props accept the number - distance from the end of the list to trigger one of these callbacks.
25 |
26 | ### Smooth scrolling experience
27 | `FlatList` from React Native accepts a prop - [maintainVisibleContentPosition](https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition), which makes sure your scroll doesn't jump to the end of the list when more items are added to the list. But this prop is only supported on iOS for now. So taking some inspiration from this [PR](https://github.com/facebook/react-native/pull/29466), we published our separate package to add support for this prop on Android - [flat-list-mvcp](https://github.com/GetStream/flat-list-mvcp#maintainvisiblecontentposition-prop-support-for-android-react-native). And thus `@stream-io/flat-list-mvcp` is a dependency of the `react-native-bidirectional-scroll` package.
28 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto init
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto init
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :init
68 | @rem Get command-line arguments, handling Windows variants
69 |
70 | if not "%OS%" == "Windows_NT" goto win9xME_args
71 |
72 | :win9xME_args
73 | @rem Slurp the command line arguments.
74 | set CMD_LINE_ARGS=
75 | set _SKIP=2
76 |
77 | :win9xME_args_slurp
78 | if "x%~1" == "x" goto execute
79 |
80 | set CMD_LINE_ARGS=%*
81 |
82 | :execute
83 | @rem Setup the command line
84 |
85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
86 |
87 | @rem Execute Gradle
88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
89 |
90 | :end
91 | @rem End local scope for the variables with windows NT shell
92 | if "%ERRORLEVEL%"=="0" goto mainEnd
93 |
94 | :fail
95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
96 | rem the _cmd.exe /c_ return code!
97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
98 | exit /b 1
99 |
100 | :mainEnd
101 | if "%OS%"=="Windows_NT" endlocal
102 |
103 | :omega
104 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/example/reactnativebidirectionalinfinitescroll/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | *
This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example.reactnativebidirectionalinfinitescroll;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
32 | client.addPlugin(new ReactFlipperPlugin());
33 | client.addPlugin(new DatabasesFlipperPlugin(context));
34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
35 | client.addPlugin(CrashReporterPlugin.getInstance());
36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
37 | NetworkingModule.setCustomClientBuilder(
38 | new NetworkingModule.CustomClientBuilder() {
39 | @Override
40 | public void apply(OkHttpClient.Builder builder) {
41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
42 | }
43 | });
44 | client.addPlugin(networkFlipperPlugin);
45 | client.start();
46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
47 | // Hence we run if after all native modules have been initialized
48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
49 | if (reactContext == null) {
50 | reactInstanceManager.addReactInstanceEventListener(
51 | new ReactInstanceManager.ReactInstanceEventListener() {
52 | @Override
53 | public void onReactContextInitialized(ReactContext reactContext) {
54 | reactInstanceManager.removeReactInstanceEventListener(this);
55 | reactContext.runOnNativeModulesQueueThread(
56 | new Runnable() {
57 | @Override
58 | public void run() {
59 | client.addPlugin(new FrescoFlipperPlugin());
60 | }
61 | });
62 | }
63 | });
64 | } else {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/website/docs/props.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Props
3 | slug: /props
4 | ---
5 |
6 | This package is a wrapper around react-native's FlatList. So it accepts all the props from `FlatList`, except for [`maintainVisibleContentPosition`](https://reactnative.dev/docs/0.63/scrollview#maintainvisiblecontentposition). It has support for following additional props, to fine tune your infinite scroll.
7 |
8 |
9 | ### `onEndReached`
10 |
11 | Called once when the scroll position gets close to end of list. This must return a promise.
12 | You can `onEndReachedThreshold` as distance from end of list, when this function should be called.
13 |
14 |
15 | | type | default | required |
16 | | -------- | ------- | -------- |
17 | | function | null | YES |
18 |
19 |
20 | ### `onStartReached`
21 |
22 | Called once when the scroll position gets close to begining of list. This must return a promise.
23 | You can `onStartReachedThreshold` as distance from beginning of list, when this function should be called.
24 |
25 | | type | default | required |
26 | | -------- | ------- | -------- |
27 | | function | null | YES |
28 |
29 | ### `activityIndicatorColor`
30 |
31 | Color for inline loading indicator
32 |
33 | | type | default | required |
34 | | ------ | ------- | -------- |
35 | | string | #000000 | NO |
36 |
37 | ### `enableAutoscrollToTop`
38 |
39 | Enable autoScrollToTop.
40 | In chat type applications, you want to auto scroll to bottom, when new message comes it.
41 |
42 | | type | default | required |
43 | | ------ | ------- | -------- |
44 | | string | false | NO |
45 |
46 | ### `autoscrollToTopThreshold`
47 |
48 | The scroll offset threshold, below which auto scrolling should occur.
49 |
50 | :::info
51 |
52 | This prop only works, when `enableAutoscrollToTop` is set to true.
53 |
54 | :::
55 |
56 | | type | default | required |
57 | | -------- | ------- | -------- |
58 | | number | 100 | NO |
59 |
60 |
61 | ### `onStartReachedThreshold`
62 |
63 | Scroll offset from beginning of list, when onStartReached should be called.
64 |
65 | | type | default | required |
66 | | -------- | ------- | -------- |
67 | | number | 10 | NO |
68 |
69 | ### `onEndReachedThreshold`
70 |
71 | Scroll distance from end of list, when onStartReached should be called.
72 | Please note that this is different from onEndReachedThreshold of FlatList from react-native.
73 |
74 | | type | default | required |
75 | | -------- | ------- | -------- |
76 | | number | 10 | NO |
77 |
78 | ### `showDefaultLoadingIndicators`
79 |
80 | If true, inline loading indicators will be shown
81 |
82 | | type | default | required |
83 | | -------- | ------- | -------- |
84 | | boolean | true | NO |
85 |
86 | ### `HeaderLoadingIndicator`
87 |
88 | Custom UI component for header inline loading indicator
89 |
90 | | type | default | required |
91 | | -------- | ------- | -------- |
92 | | Component | [ActivityIndicator](https://reactnative.dev/docs/0.63/activityindicator) | NO |
93 |
94 |
95 | ### `FooterLoadingIndicator`
96 |
97 | Custom UI component for footer inline loading indicator
98 |
99 | | type | default | required |
100 | | -------- | ------- | -------- |
101 | | Component | [ActivityIndicator](https://reactnative.dev/docs/0.63/activityindicator) | NO |
102 |
103 |
104 | ### `ListHeaderComponent`
105 |
106 | Custom UI component for header indicator of FlatList, which overrides the HeaderLoadingIndicator. Only used when `showDefaultLoadingIndicators` is false
107 |
108 | | type | default | required |
109 | | -------- | ------- | -------- |
110 | | Component | null | NO |
111 |
112 |
113 | ### `ListFooterComponent`
114 |
115 | Custom UI component for footer indicator of FlatList, which overrides the FooterLoadingIndicator. Only used when `showDefaultLoadingIndicators` is false
116 |
117 | | type | default | required |
118 | | -------- | ------- | -------- |
119 | | Component | null | NO |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-bidirectional-infinite-scroll",
3 | "version": "0.3.3",
4 | "description": "Birectional infinite scroll for react-native",
5 | "main": "lib/commonjs/index",
6 | "module": "lib/module/index",
7 | "types": "lib/typescript/index.d.ts",
8 | "react-native": "src/index",
9 | "source": "src/index",
10 | "files": [
11 | "src",
12 | "lib",
13 | "android",
14 | "ios",
15 | "cpp",
16 | "react-native-bidirectional-infinite-scroll.podspec",
17 | "!lib/typescript/example",
18 | "!android/build",
19 | "!ios/build",
20 | "!**/__tests__",
21 | "!**/__fixtures__",
22 | "!**/__mocks__"
23 | ],
24 | "scripts": {
25 | "test": "jest",
26 | "typescript": "tsc --noEmit",
27 | "lint": "eslint \"**/*.{js,ts,tsx}\"",
28 | "prepare": "bob build",
29 | "release": "release-it",
30 | "example": "yarn --cwd example",
31 | "pods": "cd example && pod-install --quiet",
32 | "bootstrap": "yarn example && yarn && yarn pods"
33 | },
34 | "keywords": [
35 | "react-native",
36 | "ios",
37 | "android"
38 | ],
39 | "repository": "https://github.com/GetStream/react-native-bidirectional-infinite-scroll",
40 | "author": "vishtree (https://github.com/vishalnarkhede)",
41 | "license": "MIT",
42 | "bugs": {
43 | "url": "https://github.com/GetStream/react-native-bidirectional-infinite-scroll/issues"
44 | },
45 | "homepage": "https://github.com/GetStream/react-native-bidirectional-infinite-scroll#readme",
46 | "publishConfig": {
47 | "registry": "https://registry.npmjs.org/"
48 | },
49 | "devDependencies": {
50 | "@commitlint/config-conventional": "^11.0.0",
51 | "@react-native-community/eslint-config": "^2.0.0",
52 | "@release-it/conventional-changelog": "^2.0.0",
53 | "@stream-io/flat-list-mvcp": "^0.10.0",
54 | "@types/jest": "^26.0.0",
55 | "@types/react": "^16.9.19",
56 | "@types/react-native": "0.63.50",
57 | "commitlint": "^11.0.0",
58 | "eslint": "^7.2.0",
59 | "eslint-config-prettier": "^7.0.0",
60 | "eslint-plugin-prettier": "^3.1.3",
61 | "husky": "^4.2.5",
62 | "jest": "^26.0.1",
63 | "pod-install": "^0.1.0",
64 | "prettier": "^2.0.5",
65 | "react": "16.13.1",
66 | "react-native": "0.63.4",
67 | "react-native-builder-bob": "^0.17.1",
68 | "release-it": "^14.2.2",
69 | "typescript": "^4.1.3"
70 | },
71 | "peerDependencies": {
72 | "@stream-io/flat-list-mvcp": ">=0.10.0",
73 | "react": "*",
74 | "react-native": "*"
75 | },
76 | "jest": {
77 | "preset": "react-native",
78 | "modulePathIgnorePatterns": [
79 | "/example/node_modules",
80 | "/lib/"
81 | ]
82 | },
83 | "husky": {
84 | "hooks": {
85 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
86 | "pre-commit": "yarn lint && yarn typescript"
87 | }
88 | },
89 | "commitlint": {
90 | "extends": [
91 | "@commitlint/config-conventional"
92 | ]
93 | },
94 | "release-it": {
95 | "git": {
96 | "commitMessage": "chore: release ${version}",
97 | "tagName": "v${version}"
98 | },
99 | "npm": {
100 | "publish": true
101 | },
102 | "github": {
103 | "release": true
104 | },
105 | "plugins": {
106 | "@release-it/conventional-changelog": {
107 | "preset": "angular"
108 | }
109 | }
110 | },
111 | "eslintConfig": {
112 | "root": true,
113 | "extends": [
114 | "@react-native-community",
115 | "prettier"
116 | ],
117 | "rules": {
118 | "prettier/prettier": [
119 | "error",
120 | {
121 | "quoteProps": "consistent",
122 | "singleQuote": true,
123 | "tabWidth": 2,
124 | "trailingComma": "es5",
125 | "useTabs": false
126 | }
127 | ]
128 | }
129 | },
130 | "eslintIgnore": [
131 | "node_modules/",
132 | "lib/"
133 | ],
134 | "prettier": {
135 | "quoteProps": "consistent",
136 | "singleQuote": true,
137 | "tabWidth": 2,
138 | "trailingComma": "es5",
139 | "useTabs": false
140 | },
141 | "react-native-builder-bob": {
142 | "source": "src",
143 | "output": "lib",
144 | "targets": [
145 | "commonjs",
146 | "module",
147 | [
148 | "typescript",
149 | {
150 | "project": "tsconfig.build.json"
151 | }
152 | ]
153 | ]
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalInfiniteScrollExample.xcodeproj/xcshareddata/xcschemes/BidirectionalInfiniteScrollExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
81 |
83 |
89 |
90 |
91 |
92 |
94 |
95 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalInfiniteScrollExample/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/website/static/img/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin or MSYS, switch paths to Windows format before running java
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=`expr $i + 1`
158 | done
159 | case $i in
160 | 0) set -- ;;
161 | 1) set -- "$args0" ;;
162 | 2) set -- "$args0" "$args1" ;;
163 | 3) set -- "$args0" "$args1" "$args2" ;;
164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=`save "$@"`
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | exec "$JAVACMD" "$@"
184 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4 |
5 | ## Development workflow
6 |
7 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
8 |
9 | ```sh
10 | yarn
11 | ```
12 |
13 | While developing, you can run the [example app](/example/) to test your changes.
14 |
15 | To start the packager:
16 |
17 | ```sh
18 | yarn example start
19 | ```
20 |
21 | To run the example app on Android:
22 |
23 | ```sh
24 | yarn example android
25 | ```
26 |
27 | To run the example app on iOS:
28 |
29 | ```sh
30 | yarn example ios
31 | ```
32 |
33 | Make sure your code passes TypeScript and ESLint. Run the following to verify:
34 |
35 | ```sh
36 | yarn typescript
37 | yarn lint
38 | ```
39 |
40 | To fix formatting errors, run the following:
41 |
42 | ```sh
43 | yarn lint --fix
44 | ```
45 |
46 | Remember to add tests for your change if possible. Run the unit tests by:
47 |
48 | ```sh
49 | yarn test
50 | ```
51 |
52 | To edit the Objective-C files, open `example/ios/BidirectionalInfiniteScrollExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-bidirectional-infinite-scroll`.
53 |
54 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativebidirectionalinfinitescroll` under `Android`.
55 |
56 | ### Commit message convention
57 |
58 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
59 |
60 | - `fix`: bug fixes, e.g. fix crash due to deprecated method.
61 | - `feat`: new features, e.g. add new method to the module.
62 | - `refactor`: code refactor, e.g. migrate from class components to hooks.
63 | - `docs`: changes into documentation, e.g. add usage example for the module..
64 | - `test`: adding or updating tests, e.g. add integration tests using detox.
65 | - `chore`: tooling changes, e.g. change CI config.
66 |
67 | Our pre-commit hooks verify that your commit message matches this format when committing.
68 |
69 | ### Linting and tests
70 |
71 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
72 |
73 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
74 |
75 | Our pre-commit hooks verify that the linter and tests pass when committing.
76 |
77 | ### Scripts
78 |
79 | The `package.json` file contains various scripts for common tasks:
80 |
81 | - `yarn bootstrap`: setup project by installing all dependencies and pods.
82 | - `yarn typescript`: type-check files with TypeScript.
83 | - `yarn lint`: lint files with ESLint.
84 | - `yarn test`: run unit tests with Jest.
85 | - `yarn example start`: start the Metro server for the example app.
86 | - `yarn example android`: run the example app on Android.
87 | - `yarn example ios`: run the example app on iOS.
88 |
89 | ### Sending a pull request
90 |
91 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
92 |
93 | When you're sending a pull request:
94 |
95 | - Prefer small pull requests focused on one change.
96 | - Verify that linters and tests are passing.
97 | - Review the documentation to make sure it looks good.
98 | - Follow the pull request template when opening a pull request.
99 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
100 |
101 | ## Code of Conduct
102 |
103 | ### Our Pledge
104 |
105 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
106 |
107 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
108 |
109 | ### Our Standards
110 |
111 | Examples of behavior that contributes to a positive environment for our community include:
112 |
113 | - Demonstrating empathy and kindness toward other people
114 | - Being respectful of differing opinions, viewpoints, and experiences
115 | - Giving and gracefully accepting constructive feedback
116 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
117 | - Focusing on what is best not just for us as individuals, but for the overall community
118 |
119 | Examples of unacceptable behavior include:
120 |
121 | - The use of sexualized language or imagery, and sexual attention or
122 | advances of any kind
123 | - Trolling, insulting or derogatory comments, and personal or political attacks
124 | - Public or private harassment
125 | - Publishing others' private information, such as a physical or email
126 | address, without their explicit permission
127 | - Other conduct which could reasonably be considered inappropriate in a
128 | professional setting
129 |
130 | ### Enforcement Responsibilities
131 |
132 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
133 |
134 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
135 |
136 | ### Scope
137 |
138 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
139 |
140 | ### Enforcement
141 |
142 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
143 |
144 | All community leaders are obligated to respect the privacy and security of the reporter of any incident.
145 |
146 | ### Enforcement Guidelines
147 |
148 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
149 |
150 | #### 1. Correction
151 |
152 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
153 |
154 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
155 |
156 | #### 2. Warning
157 |
158 | **Community Impact**: A violation through a single incident or series of actions.
159 |
160 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
161 |
162 | #### 3. Temporary Ban
163 |
164 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
165 |
166 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
167 |
168 | #### 4. Permanent Ban
169 |
170 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
171 |
172 | **Consequence**: A permanent ban from any sort of public interaction within the community.
173 |
174 | ### Attribution
175 |
176 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
177 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
178 |
179 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
180 |
181 | [homepage]: https://www.contributor-covenant.org
182 |
183 | For answers to common questions about this code of conduct, see the FAQ at
184 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
185 |
--------------------------------------------------------------------------------
/src/BidirectionalFlatList.tsx:
--------------------------------------------------------------------------------
1 | import React, { MutableRefObject, useRef, useState } from 'react';
2 | import {
3 | ActivityIndicator,
4 | FlatList as FlatListType,
5 | FlatListProps,
6 | ScrollViewProps,
7 | StyleSheet,
8 | View,
9 | } from 'react-native';
10 | import { FlatList } from '@stream-io/flat-list-mvcp';
11 |
12 | const styles = StyleSheet.create({
13 | indicatorContainer: {
14 | paddingVertical: 5,
15 | width: '100%',
16 | },
17 | });
18 |
19 | export type Props = Omit<
20 | FlatListProps,
21 | 'maintainVisibleContentPosition'
22 | > & {
23 | /**
24 | * Called once when the scroll position gets close to end of list. This must return a promise.
25 | * You can `onEndReachedThreshold` as distance from end of list, when this function should be called.
26 | */
27 | onEndReached: () => Promise;
28 | /**
29 | * Called once when the scroll position gets close to begining of list. This must return a promise.
30 | * You can `onStartReachedThreshold` as distance from beginning of list, when this function should be called.
31 | */
32 | onStartReached: () => Promise;
33 | /** Color for inline loading indicator */
34 | activityIndicatorColor?: string;
35 | /**
36 | * Enable autoScrollToTop.
37 | * In chat type applications, you want to auto scroll to bottom, when new message comes it.
38 | */
39 | enableAutoscrollToTop?: boolean;
40 | /**
41 | * If `enableAutoscrollToTop` is true, the scroll threshold below which auto scrolling should occur.
42 | */
43 | autoscrollToTopThreshold?: number;
44 | /** Scroll distance from beginning of list, when onStartReached should be called. */
45 | onStartReachedThreshold?: number;
46 | /**
47 | * Scroll distance from end of list, when onStartReached should be called.
48 | * Please note that this is different from onEndReachedThreshold of FlatList from react-native.
49 | */
50 | onEndReachedThreshold?: number;
51 | /** If true, inline loading indicators will be shown. Default - true */
52 | showDefaultLoadingIndicators?: boolean;
53 | /** Custom UI component for header inline loading indicator */
54 | HeaderLoadingIndicator?: React.ComponentType;
55 | /** Custom UI component for footer inline loading indicator */
56 | FooterLoadingIndicator?: React.ComponentType;
57 | /** Custom UI component for header indicator of FlatList. Only used when `showDefaultLoadingIndicators` is false */
58 | ListHeaderComponent?: React.ComponentType;
59 | /** Custom UI component for footer indicator of FlatList. Only used when `showDefaultLoadingIndicators` is false */
60 | ListFooterComponent?: React.ComponentType;
61 | };
62 | /**
63 | * Note:
64 | * - `onEndReached` and `onStartReached` must return a promise.
65 | * - `onEndReached` and `onStartReached` only get called once, per content length.
66 | * - maintainVisibleContentPosition is fixed, and can't be modified through props.
67 | * - doesn't accept `ListFooterComponent` via prop, since it is occupied by `FooterLoadingIndicator`.
68 | * Set `showDefaultLoadingIndicators` to use `ListFooterComponent`.
69 | * - doesn't accept `ListHeaderComponent` via prop, since it is occupied by `HeaderLoadingIndicator`
70 | * Set `showDefaultLoadingIndicators` to use `ListHeaderComponent`.
71 | */
72 | export const BidirectionalFlatList = (React.forwardRef(
73 | (
74 | props: Props,
75 | ref:
76 | | ((instance: FlatListType | null) => void)
77 | | MutableRefObject | null>
78 | | null
79 | ) => {
80 | const {
81 | activityIndicatorColor = 'black',
82 | autoscrollToTopThreshold = 100,
83 | data,
84 | enableAutoscrollToTop,
85 | FooterLoadingIndicator,
86 | HeaderLoadingIndicator,
87 | ListHeaderComponent,
88 | ListFooterComponent,
89 | onEndReached = () => Promise.resolve(),
90 | onEndReachedThreshold = 10,
91 | onScroll,
92 | onStartReached = () => Promise.resolve(),
93 | onStartReachedThreshold = 10,
94 | showDefaultLoadingIndicators = true,
95 | } = props;
96 | const [onStartReachedInProgress, setOnStartReachedInProgress] = useState(
97 | false
98 | );
99 | const [onEndReachedInProgress, setOnEndReachedInProgress] = useState(false);
100 |
101 | const onStartReachedTracker = useRef>({});
102 | const onEndReachedTracker = useRef>({});
103 |
104 | const onStartReachedInPromise = useRef | null>(null);
105 | const onEndReachedInPromise = useRef | null>(null);
106 |
107 | const maybeCallOnStartReached = () => {
108 | // If onStartReached has already been called for given data length, then ignore.
109 | if (data?.length && onStartReachedTracker.current[data.length]) {
110 | return;
111 | }
112 |
113 | if (data?.length) {
114 | onStartReachedTracker.current[data.length] = true;
115 | }
116 |
117 | setOnStartReachedInProgress(true);
118 | const p = () => {
119 | return new Promise((resolve) => {
120 | onStartReachedInPromise.current = null;
121 | setOnStartReachedInProgress(false);
122 | resolve();
123 | });
124 | };
125 |
126 | if (onEndReachedInPromise.current) {
127 | onEndReachedInPromise.current.finally(() => {
128 | onStartReachedInPromise.current = onStartReached().then(p);
129 | });
130 | } else {
131 | onStartReachedInPromise.current = onStartReached().then(p);
132 | }
133 | };
134 |
135 | const maybeCallOnEndReached = () => {
136 | // If onEndReached has already been called for given data length, then ignore.
137 | if (data?.length && onEndReachedTracker.current[data.length]) {
138 | return;
139 | }
140 |
141 | if (data?.length) {
142 | onEndReachedTracker.current[data.length] = true;
143 | }
144 |
145 | setOnEndReachedInProgress(true);
146 | const p = () => {
147 | return new Promise((resolve) => {
148 | onStartReachedInPromise.current = null;
149 | setOnEndReachedInProgress(false);
150 | resolve();
151 | });
152 | };
153 |
154 | if (onStartReachedInPromise.current) {
155 | onStartReachedInPromise.current.finally(() => {
156 | onEndReachedInPromise.current = onEndReached().then(p);
157 | });
158 | } else {
159 | onEndReachedInPromise.current = onEndReached().then(p);
160 | }
161 | };
162 |
163 | const handleScroll: ScrollViewProps['onScroll'] = (event) => {
164 | // Call the parent onScroll handler, if provided.
165 | onScroll?.(event);
166 |
167 | const offset = event.nativeEvent.contentOffset.y;
168 | const visibleLength = event.nativeEvent.layoutMeasurement.height;
169 | const contentLength = event.nativeEvent.contentSize.height;
170 |
171 | // Check if scroll has reached either start of end of list.
172 | const isScrollAtStart = offset < onStartReachedThreshold;
173 | const isScrollAtEnd =
174 | contentLength - visibleLength - offset < onEndReachedThreshold;
175 |
176 | if (isScrollAtStart) {
177 | maybeCallOnStartReached();
178 | }
179 |
180 | if (isScrollAtEnd) {
181 | maybeCallOnEndReached();
182 | }
183 | };
184 |
185 | const renderHeaderLoadingIndicator = () => {
186 | if (!showDefaultLoadingIndicators) {
187 | if (ListHeaderComponent) {
188 | return ;
189 | } else {
190 | return null;
191 | }
192 | }
193 |
194 | if (!onStartReachedInProgress) return null;
195 |
196 | if (HeaderLoadingIndicator) {
197 | return ;
198 | }
199 |
200 | return (
201 |
202 |
203 |
204 | );
205 | };
206 |
207 | const renderFooterLoadingIndicator = () => {
208 | if (!showDefaultLoadingIndicators) {
209 | if (ListFooterComponent) {
210 | return ;
211 | } else {
212 | return null;
213 | }
214 | }
215 |
216 | if (!onEndReachedInProgress) return null;
217 |
218 | if (FooterLoadingIndicator) {
219 | return ;
220 | }
221 |
222 | return (
223 |
224 |
225 |
226 | );
227 | };
228 |
229 | return (
230 | <>
231 |
232 | {...props}
233 | ref={ref}
234 | progressViewOffset={50}
235 | ListHeaderComponent={renderHeaderLoadingIndicator}
236 | ListFooterComponent={renderFooterLoadingIndicator}
237 | onEndReached={null}
238 | onScroll={handleScroll}
239 | maintainVisibleContentPosition={{
240 | autoscrollToTopThreshold: enableAutoscrollToTop
241 | ? autoscrollToTopThreshold
242 | : undefined,
243 | minIndexForVisible: 1,
244 | }}
245 | />
246 | >
247 | );
248 | }
249 | ) as unknown) as BidirectionalFlatListType;
250 |
251 | type BidirectionalFlatListType = (
252 | props: Props
253 | ) => React.ReactElement;
254 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // https://reactnative.dev/docs/performance#enable-the-ram-format
22 | * bundleCommand: "ram-bundle",
23 | *
24 | * // whether to bundle JS and assets in debug mode
25 | * bundleInDebug: false,
26 | *
27 | * // whether to bundle JS and assets in release mode
28 | * bundleInRelease: true,
29 | *
30 | * // whether to bundle JS and assets in another build variant (if configured).
31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32 | * // The configuration property can be in the following formats
33 | * // 'bundleIn${productFlavor}${buildType}'
34 | * // 'bundleIn${buildType}'
35 | * // bundleInFreeDebug: true,
36 | * // bundleInPaidRelease: true,
37 | * // bundleInBeta: true,
38 | *
39 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
40 | * // for BidirectionalInfiniteScrollExample: to disable dev mode in the staging build type (if configured)
41 | * devDisabledInStaging: true,
42 | * // The configuration property can be in the following formats
43 | * // 'devDisabledIn${productFlavor}${buildType}'
44 | * // 'devDisabledIn${buildType}'
45 | *
46 | * // the root of your project, i.e. where "package.json" lives
47 | * root: "../../",
48 | *
49 | * // where to put the JS bundle asset in debug mode
50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51 | *
52 | * // where to put the JS bundle asset in release mode
53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54 | *
55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
56 | * // require('./image.png')), in debug mode
57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58 | *
59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
60 | * // require('./image.png')), in release mode
61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62 | *
63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67 | * // for BidirectionalInfiniteScrollExample, you might want to remove it from here.
68 | * inputExcludes: ["android/**", "ios/**"],
69 | *
70 | * // override which node gets called and with what additional arguments
71 | * nodeExecutableAndArgs: ["node"],
72 | *
73 | * // supply additional arguments to the packager
74 | * extraPackagerArgs: []
75 | * ]
76 | */
77 |
78 | project.ext.react = [
79 | enableHermes: false, // clean and rebuild if changing
80 | entryFile: "index.tsx",
81 | ]
82 |
83 | apply from: "../../node_modules/react-native/react.gradle"
84 |
85 | /**
86 | * Set this to true to create two separate APKs instead of one:
87 | * - An APK that only works on ARM devices
88 | * - An APK that only works on x86 devices
89 | * The advantage is the size of the APK is reduced by about 4MB.
90 | * Upload all the APKs to the Play Store and people will download
91 | * the correct one based on the CPU architecture of their device.
92 | */
93 | def enableSeparateBuildPerCPUArchitecture = false
94 |
95 | /**
96 | * Run Proguard to shrink the Java bytecode in release builds.
97 | */
98 | def enableProguardInReleaseBuilds = false
99 |
100 | /**
101 | * The preferred build flavor of JavaScriptCore.
102 | *
103 | * For BidirectionalInfiniteScrollExample, to use the international variant, you can use:
104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105 | *
106 | * The international variant includes ICU i18n library and necessary data
107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108 | * give correct results when using with locales other than en-US. Note that
109 | * this variant is about 6MiB larger per architecture than default.
110 | */
111 | def jscFlavor = 'org.webkit:android-jsc:+'
112 |
113 | /**
114 | * Whether to enable the Hermes VM.
115 | *
116 | * This should be set on project.ext.react and mirrored here. If it is not set
117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118 | * and the benefits of using Hermes will therefore be sharply reduced.
119 | */
120 | def enableHermes = project.ext.react.get("enableHermes", false);
121 |
122 | android {
123 | compileSdkVersion rootProject.ext.compileSdkVersion
124 |
125 | compileOptions {
126 | sourceCompatibility JavaVersion.VERSION_1_8
127 | targetCompatibility JavaVersion.VERSION_1_8
128 | }
129 |
130 | defaultConfig {
131 | applicationId "com.example.reactnativebidirectionalinfinitescroll"
132 | minSdkVersion rootProject.ext.minSdkVersion
133 | targetSdkVersion rootProject.ext.targetSdkVersion
134 | versionCode 1
135 | versionName "1.0"
136 | }
137 | splits {
138 | abi {
139 | reset()
140 | enable enableSeparateBuildPerCPUArchitecture
141 | universalApk false // If true, also generate a universal APK
142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
143 | }
144 | }
145 | signingConfigs {
146 | debug {
147 | storeFile file('debug.keystore')
148 | storePassword 'android'
149 | keyAlias 'androiddebugkey'
150 | keyPassword 'android'
151 | }
152 | }
153 | buildTypes {
154 | debug {
155 | signingConfig signingConfigs.debug
156 | }
157 | release {
158 | // Caution! In production, you need to generate your own keystore file.
159 | // see https://reactnative.dev/docs/signed-apk-android.
160 | signingConfig signingConfigs.debug
161 | minifyEnabled enableProguardInReleaseBuilds
162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
163 | }
164 | }
165 | // applicationVariants are e.g. debug, release
166 | applicationVariants.all { variant ->
167 | variant.outputs.each { output ->
168 | // For each separate APK per architecture, set a unique version code as described here:
169 | // https://developer.android.com/studio/build/configure-apk-splits.html
170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
171 | def abi = output.getFilter(OutputFile.ABI)
172 | if (abi != null) { // null for the universal-debug, universal-release variants
173 | output.versionCodeOverride =
174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
175 | }
176 |
177 | }
178 | }
179 | }
180 |
181 | dependencies {
182 | implementation fileTree(dir: "libs", include: ["*.jar"])
183 | //noinspection GradleDynamicVersion
184 | implementation "com.facebook.react:react-native:+" // From node_modules
185 |
186 |
187 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
188 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
189 | exclude group:'com.facebook.fbjni'
190 | }
191 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
192 | exclude group:'com.facebook.flipper'
193 | exclude group:'com.squareup.okhttp3', module:'okhttp'
194 | }
195 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
196 | exclude group:'com.facebook.flipper'
197 | }
198 |
199 | if (enableHermes) {
200 | def hermesPath = "../../node_modules/hermes-engine/android/";
201 | debugImplementation files(hermesPath + "hermes-debug.aar")
202 | releaseImplementation files(hermesPath + "hermes-release.aar")
203 | } else {
204 | implementation jscFlavor
205 | }
206 |
207 | }
208 |
209 | // Run this once to be able to run the application with BUCK
210 | // puts all compile dependencies into folder libs for BUCK to use
211 | task copyDownloadableDepsToLibs(type: Copy) {
212 | from configurations.compile
213 | into 'libs'
214 | }
215 |
216 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
217 |
--------------------------------------------------------------------------------
/website/static/img/undraw_docusaurus_tree.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost-for-react-native (1.63.0)
3 | - CocoaAsyncSocket (7.6.5)
4 | - DoubleConversion (1.1.6)
5 | - FBLazyVector (0.63.4)
6 | - FBReactNativeSpec (0.63.4):
7 | - Folly (= 2020.01.13.00)
8 | - RCTRequired (= 0.63.4)
9 | - RCTTypeSafety (= 0.63.4)
10 | - React-Core (= 0.63.4)
11 | - React-jsi (= 0.63.4)
12 | - ReactCommon/turbomodule/core (= 0.63.4)
13 | - Flipper (0.75.1):
14 | - Flipper-Folly (~> 2.5)
15 | - Flipper-RSocket (~> 1.3)
16 | - Flipper-DoubleConversion (1.1.7)
17 | - Flipper-Folly (2.5.1):
18 | - boost-for-react-native
19 | - Flipper-DoubleConversion
20 | - Flipper-Glog
21 | - libevent (~> 2.1.12)
22 | - OpenSSL-Universal (= 1.1.180)
23 | - Flipper-Glog (0.3.6)
24 | - Flipper-PeerTalk (0.0.4)
25 | - Flipper-RSocket (1.3.0):
26 | - Flipper-Folly (~> 2.5)
27 | - FlipperKit (0.75.1):
28 | - FlipperKit/Core (= 0.75.1)
29 | - FlipperKit/Core (0.75.1):
30 | - Flipper (~> 0.75.1)
31 | - FlipperKit/CppBridge
32 | - FlipperKit/FBCxxFollyDynamicConvert
33 | - FlipperKit/FBDefines
34 | - FlipperKit/FKPortForwarding
35 | - FlipperKit/CppBridge (0.75.1):
36 | - Flipper (~> 0.75.1)
37 | - FlipperKit/FBCxxFollyDynamicConvert (0.75.1):
38 | - Flipper-Folly (~> 2.5)
39 | - FlipperKit/FBDefines (0.75.1)
40 | - FlipperKit/FKPortForwarding (0.75.1):
41 | - CocoaAsyncSocket (~> 7.6)
42 | - Flipper-PeerTalk (~> 0.0.4)
43 | - FlipperKit/FlipperKitHighlightOverlay (0.75.1)
44 | - FlipperKit/FlipperKitLayoutPlugin (0.75.1):
45 | - FlipperKit/Core
46 | - FlipperKit/FlipperKitHighlightOverlay
47 | - FlipperKit/FlipperKitLayoutTextSearchable
48 | - YogaKit (~> 1.18)
49 | - FlipperKit/FlipperKitLayoutTextSearchable (0.75.1)
50 | - FlipperKit/FlipperKitNetworkPlugin (0.75.1):
51 | - FlipperKit/Core
52 | - FlipperKit/FlipperKitReactPlugin (0.75.1):
53 | - FlipperKit/Core
54 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.75.1):
55 | - FlipperKit/Core
56 | - FlipperKit/SKIOSNetworkPlugin (0.75.1):
57 | - FlipperKit/Core
58 | - FlipperKit/FlipperKitNetworkPlugin
59 | - Folly (2020.01.13.00):
60 | - boost-for-react-native
61 | - DoubleConversion
62 | - Folly/Default (= 2020.01.13.00)
63 | - glog
64 | - Folly/Default (2020.01.13.00):
65 | - boost-for-react-native
66 | - DoubleConversion
67 | - glog
68 | - glog (0.3.5)
69 | - libevent (2.1.12)
70 | - OpenSSL-Universal (1.1.180)
71 | - RCTRequired (0.63.4)
72 | - RCTTypeSafety (0.63.4):
73 | - FBLazyVector (= 0.63.4)
74 | - Folly (= 2020.01.13.00)
75 | - RCTRequired (= 0.63.4)
76 | - React-Core (= 0.63.4)
77 | - React (0.63.4):
78 | - React-Core (= 0.63.4)
79 | - React-Core/DevSupport (= 0.63.4)
80 | - React-Core/RCTWebSocket (= 0.63.4)
81 | - React-RCTActionSheet (= 0.63.4)
82 | - React-RCTAnimation (= 0.63.4)
83 | - React-RCTBlob (= 0.63.4)
84 | - React-RCTImage (= 0.63.4)
85 | - React-RCTLinking (= 0.63.4)
86 | - React-RCTNetwork (= 0.63.4)
87 | - React-RCTSettings (= 0.63.4)
88 | - React-RCTText (= 0.63.4)
89 | - React-RCTVibration (= 0.63.4)
90 | - React-callinvoker (0.63.4)
91 | - React-Core (0.63.4):
92 | - Folly (= 2020.01.13.00)
93 | - glog
94 | - React-Core/Default (= 0.63.4)
95 | - React-cxxreact (= 0.63.4)
96 | - React-jsi (= 0.63.4)
97 | - React-jsiexecutor (= 0.63.4)
98 | - Yoga
99 | - React-Core/CoreModulesHeaders (0.63.4):
100 | - Folly (= 2020.01.13.00)
101 | - glog
102 | - React-Core/Default
103 | - React-cxxreact (= 0.63.4)
104 | - React-jsi (= 0.63.4)
105 | - React-jsiexecutor (= 0.63.4)
106 | - Yoga
107 | - React-Core/Default (0.63.4):
108 | - Folly (= 2020.01.13.00)
109 | - glog
110 | - React-cxxreact (= 0.63.4)
111 | - React-jsi (= 0.63.4)
112 | - React-jsiexecutor (= 0.63.4)
113 | - Yoga
114 | - React-Core/DevSupport (0.63.4):
115 | - Folly (= 2020.01.13.00)
116 | - glog
117 | - React-Core/Default (= 0.63.4)
118 | - React-Core/RCTWebSocket (= 0.63.4)
119 | - React-cxxreact (= 0.63.4)
120 | - React-jsi (= 0.63.4)
121 | - React-jsiexecutor (= 0.63.4)
122 | - React-jsinspector (= 0.63.4)
123 | - Yoga
124 | - React-Core/RCTActionSheetHeaders (0.63.4):
125 | - Folly (= 2020.01.13.00)
126 | - glog
127 | - React-Core/Default
128 | - React-cxxreact (= 0.63.4)
129 | - React-jsi (= 0.63.4)
130 | - React-jsiexecutor (= 0.63.4)
131 | - Yoga
132 | - React-Core/RCTAnimationHeaders (0.63.4):
133 | - Folly (= 2020.01.13.00)
134 | - glog
135 | - React-Core/Default
136 | - React-cxxreact (= 0.63.4)
137 | - React-jsi (= 0.63.4)
138 | - React-jsiexecutor (= 0.63.4)
139 | - Yoga
140 | - React-Core/RCTBlobHeaders (0.63.4):
141 | - Folly (= 2020.01.13.00)
142 | - glog
143 | - React-Core/Default
144 | - React-cxxreact (= 0.63.4)
145 | - React-jsi (= 0.63.4)
146 | - React-jsiexecutor (= 0.63.4)
147 | - Yoga
148 | - React-Core/RCTImageHeaders (0.63.4):
149 | - Folly (= 2020.01.13.00)
150 | - glog
151 | - React-Core/Default
152 | - React-cxxreact (= 0.63.4)
153 | - React-jsi (= 0.63.4)
154 | - React-jsiexecutor (= 0.63.4)
155 | - Yoga
156 | - React-Core/RCTLinkingHeaders (0.63.4):
157 | - Folly (= 2020.01.13.00)
158 | - glog
159 | - React-Core/Default
160 | - React-cxxreact (= 0.63.4)
161 | - React-jsi (= 0.63.4)
162 | - React-jsiexecutor (= 0.63.4)
163 | - Yoga
164 | - React-Core/RCTNetworkHeaders (0.63.4):
165 | - Folly (= 2020.01.13.00)
166 | - glog
167 | - React-Core/Default
168 | - React-cxxreact (= 0.63.4)
169 | - React-jsi (= 0.63.4)
170 | - React-jsiexecutor (= 0.63.4)
171 | - Yoga
172 | - React-Core/RCTSettingsHeaders (0.63.4):
173 | - Folly (= 2020.01.13.00)
174 | - glog
175 | - React-Core/Default
176 | - React-cxxreact (= 0.63.4)
177 | - React-jsi (= 0.63.4)
178 | - React-jsiexecutor (= 0.63.4)
179 | - Yoga
180 | - React-Core/RCTTextHeaders (0.63.4):
181 | - Folly (= 2020.01.13.00)
182 | - glog
183 | - React-Core/Default
184 | - React-cxxreact (= 0.63.4)
185 | - React-jsi (= 0.63.4)
186 | - React-jsiexecutor (= 0.63.4)
187 | - Yoga
188 | - React-Core/RCTVibrationHeaders (0.63.4):
189 | - Folly (= 2020.01.13.00)
190 | - glog
191 | - React-Core/Default
192 | - React-cxxreact (= 0.63.4)
193 | - React-jsi (= 0.63.4)
194 | - React-jsiexecutor (= 0.63.4)
195 | - Yoga
196 | - React-Core/RCTWebSocket (0.63.4):
197 | - Folly (= 2020.01.13.00)
198 | - glog
199 | - React-Core/Default (= 0.63.4)
200 | - React-cxxreact (= 0.63.4)
201 | - React-jsi (= 0.63.4)
202 | - React-jsiexecutor (= 0.63.4)
203 | - Yoga
204 | - React-CoreModules (0.63.4):
205 | - FBReactNativeSpec (= 0.63.4)
206 | - Folly (= 2020.01.13.00)
207 | - RCTTypeSafety (= 0.63.4)
208 | - React-Core/CoreModulesHeaders (= 0.63.4)
209 | - React-jsi (= 0.63.4)
210 | - React-RCTImage (= 0.63.4)
211 | - ReactCommon/turbomodule/core (= 0.63.4)
212 | - React-cxxreact (0.63.4):
213 | - boost-for-react-native (= 1.63.0)
214 | - DoubleConversion
215 | - Folly (= 2020.01.13.00)
216 | - glog
217 | - React-callinvoker (= 0.63.4)
218 | - React-jsinspector (= 0.63.4)
219 | - React-jsi (0.63.4):
220 | - boost-for-react-native (= 1.63.0)
221 | - DoubleConversion
222 | - Folly (= 2020.01.13.00)
223 | - glog
224 | - React-jsi/Default (= 0.63.4)
225 | - React-jsi/Default (0.63.4):
226 | - boost-for-react-native (= 1.63.0)
227 | - DoubleConversion
228 | - Folly (= 2020.01.13.00)
229 | - glog
230 | - React-jsiexecutor (0.63.4):
231 | - DoubleConversion
232 | - Folly (= 2020.01.13.00)
233 | - glog
234 | - React-cxxreact (= 0.63.4)
235 | - React-jsi (= 0.63.4)
236 | - React-jsinspector (0.63.4)
237 | - React-RCTActionSheet (0.63.4):
238 | - React-Core/RCTActionSheetHeaders (= 0.63.4)
239 | - React-RCTAnimation (0.63.4):
240 | - FBReactNativeSpec (= 0.63.4)
241 | - Folly (= 2020.01.13.00)
242 | - RCTTypeSafety (= 0.63.4)
243 | - React-Core/RCTAnimationHeaders (= 0.63.4)
244 | - React-jsi (= 0.63.4)
245 | - ReactCommon/turbomodule/core (= 0.63.4)
246 | - React-RCTBlob (0.63.4):
247 | - FBReactNativeSpec (= 0.63.4)
248 | - Folly (= 2020.01.13.00)
249 | - React-Core/RCTBlobHeaders (= 0.63.4)
250 | - React-Core/RCTWebSocket (= 0.63.4)
251 | - React-jsi (= 0.63.4)
252 | - React-RCTNetwork (= 0.63.4)
253 | - ReactCommon/turbomodule/core (= 0.63.4)
254 | - React-RCTImage (0.63.4):
255 | - FBReactNativeSpec (= 0.63.4)
256 | - Folly (= 2020.01.13.00)
257 | - RCTTypeSafety (= 0.63.4)
258 | - React-Core/RCTImageHeaders (= 0.63.4)
259 | - React-jsi (= 0.63.4)
260 | - React-RCTNetwork (= 0.63.4)
261 | - ReactCommon/turbomodule/core (= 0.63.4)
262 | - React-RCTLinking (0.63.4):
263 | - FBReactNativeSpec (= 0.63.4)
264 | - React-Core/RCTLinkingHeaders (= 0.63.4)
265 | - React-jsi (= 0.63.4)
266 | - ReactCommon/turbomodule/core (= 0.63.4)
267 | - React-RCTNetwork (0.63.4):
268 | - FBReactNativeSpec (= 0.63.4)
269 | - Folly (= 2020.01.13.00)
270 | - RCTTypeSafety (= 0.63.4)
271 | - React-Core/RCTNetworkHeaders (= 0.63.4)
272 | - React-jsi (= 0.63.4)
273 | - ReactCommon/turbomodule/core (= 0.63.4)
274 | - React-RCTSettings (0.63.4):
275 | - FBReactNativeSpec (= 0.63.4)
276 | - Folly (= 2020.01.13.00)
277 | - RCTTypeSafety (= 0.63.4)
278 | - React-Core/RCTSettingsHeaders (= 0.63.4)
279 | - React-jsi (= 0.63.4)
280 | - ReactCommon/turbomodule/core (= 0.63.4)
281 | - React-RCTText (0.63.4):
282 | - React-Core/RCTTextHeaders (= 0.63.4)
283 | - React-RCTVibration (0.63.4):
284 | - FBReactNativeSpec (= 0.63.4)
285 | - Folly (= 2020.01.13.00)
286 | - React-Core/RCTVibrationHeaders (= 0.63.4)
287 | - React-jsi (= 0.63.4)
288 | - ReactCommon/turbomodule/core (= 0.63.4)
289 | - ReactCommon/turbomodule/core (0.63.4):
290 | - DoubleConversion
291 | - Folly (= 2020.01.13.00)
292 | - glog
293 | - React-callinvoker (= 0.63.4)
294 | - React-Core (= 0.63.4)
295 | - React-cxxreact (= 0.63.4)
296 | - React-jsi (= 0.63.4)
297 | - Yoga (1.14.0)
298 | - YogaKit (1.18.1):
299 | - Yoga (~> 1.14)
300 |
301 | DEPENDENCIES:
302 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
303 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
304 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
305 | - Flipper (= 0.75.1)
306 | - Flipper-DoubleConversion (= 1.1.7)
307 | - Flipper-Folly (~> 2.2)
308 | - Flipper-Glog (= 0.3.6)
309 | - Flipper-PeerTalk (~> 0.0.4)
310 | - Flipper-RSocket (~> 1.1)
311 | - FlipperKit (= 0.75.1)
312 | - FlipperKit/Core (= 0.75.1)
313 | - FlipperKit/CppBridge (= 0.75.1)
314 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.75.1)
315 | - FlipperKit/FBDefines (= 0.75.1)
316 | - FlipperKit/FKPortForwarding (= 0.75.1)
317 | - FlipperKit/FlipperKitHighlightOverlay (= 0.75.1)
318 | - FlipperKit/FlipperKitLayoutPlugin (= 0.75.1)
319 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.75.1)
320 | - FlipperKit/FlipperKitNetworkPlugin (= 0.75.1)
321 | - FlipperKit/FlipperKitReactPlugin (= 0.75.1)
322 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.75.1)
323 | - FlipperKit/SKIOSNetworkPlugin (= 0.75.1)
324 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
325 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
326 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
327 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
328 | - React (from `../node_modules/react-native/`)
329 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
330 | - React-Core (from `../node_modules/react-native/`)
331 | - React-Core/DevSupport (from `../node_modules/react-native/`)
332 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
333 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
334 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
335 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
336 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
337 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
338 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
339 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
340 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
341 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
342 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
343 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
344 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
345 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
346 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
347 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
348 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
349 |
350 | SPEC REPOS:
351 | trunk:
352 | - boost-for-react-native
353 | - CocoaAsyncSocket
354 | - Flipper
355 | - Flipper-DoubleConversion
356 | - Flipper-Folly
357 | - Flipper-Glog
358 | - Flipper-PeerTalk
359 | - Flipper-RSocket
360 | - FlipperKit
361 | - libevent
362 | - OpenSSL-Universal
363 | - YogaKit
364 |
365 | EXTERNAL SOURCES:
366 | DoubleConversion:
367 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
368 | FBLazyVector:
369 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
370 | FBReactNativeSpec:
371 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
372 | Folly:
373 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
374 | glog:
375 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
376 | RCTRequired:
377 | :path: "../node_modules/react-native/Libraries/RCTRequired"
378 | RCTTypeSafety:
379 | :path: "../node_modules/react-native/Libraries/TypeSafety"
380 | React:
381 | :path: "../node_modules/react-native/"
382 | React-callinvoker:
383 | :path: "../node_modules/react-native/ReactCommon/callinvoker"
384 | React-Core:
385 | :path: "../node_modules/react-native/"
386 | React-CoreModules:
387 | :path: "../node_modules/react-native/React/CoreModules"
388 | React-cxxreact:
389 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
390 | React-jsi:
391 | :path: "../node_modules/react-native/ReactCommon/jsi"
392 | React-jsiexecutor:
393 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
394 | React-jsinspector:
395 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
396 | React-RCTActionSheet:
397 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
398 | React-RCTAnimation:
399 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
400 | React-RCTBlob:
401 | :path: "../node_modules/react-native/Libraries/Blob"
402 | React-RCTImage:
403 | :path: "../node_modules/react-native/Libraries/Image"
404 | React-RCTLinking:
405 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
406 | React-RCTNetwork:
407 | :path: "../node_modules/react-native/Libraries/Network"
408 | React-RCTSettings:
409 | :path: "../node_modules/react-native/Libraries/Settings"
410 | React-RCTText:
411 | :path: "../node_modules/react-native/Libraries/Text"
412 | React-RCTVibration:
413 | :path: "../node_modules/react-native/Libraries/Vibration"
414 | ReactCommon:
415 | :path: "../node_modules/react-native/ReactCommon"
416 | Yoga:
417 | :path: "../node_modules/react-native/ReactCommon/yoga"
418 |
419 | SPEC CHECKSUMS:
420 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
421 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
422 | DoubleConversion: cde416483dac037923206447da6e1454df403714
423 | FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
424 | FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
425 | Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021
426 | Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
427 | Flipper-Folly: f7a3caafbd74bda4827954fd7a6e000e36355489
428 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
429 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
430 | Flipper-RSocket: 602921fee03edacf18f5d6f3d3594ba477f456e5
431 | FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
432 | Folly: b73c3869541e86821df3c387eb0af5f65addfab4
433 | glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
434 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
435 | OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
436 | RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e
437 | RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b
438 | React: b0a957a2c44da4113b0c4c9853d8387f8e64e615
439 | React-callinvoker: c3f44dd3cb195b6aa46621fff95ded79d59043fe
440 | React-Core: d3b2a1ac9a2c13c3bcde712d9281fc1c8a5b315b
441 | React-CoreModules: 0581ff36cb797da0943d424f69e7098e43e9be60
442 | React-cxxreact: c1480d4fda5720086c90df537ee7d285d4c57ac3
443 | React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31
444 | React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949
445 | React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a
446 | React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
447 | React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
448 | React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0
449 | React-RCTImage: c1b1f2d3f43a4a528c8946d6092384b5c880d2f0
450 | React-RCTLinking: 35ae4ab9dc0410d1fcbdce4d7623194a27214fb2
451 | React-RCTNetwork: 29ec2696f8d8cfff7331fac83d3e893c95ef43ae
452 | React-RCTSettings: 60f0691bba2074ef394f95d4c2265ec284e0a46a
453 | React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c
454 | React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d
455 | ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
456 | Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6
457 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
458 |
459 | PODFILE CHECKSUM: 1ca5afe4c648999e1758a6b79555559960b291df
460 |
461 | COCOAPODS: 1.10.1
462 |
--------------------------------------------------------------------------------
/website/static/img/undraw_docusaurus_mountain.svg:
--------------------------------------------------------------------------------
1 |
171 |
--------------------------------------------------------------------------------
/website/static/img/undraw_docusaurus_react.svg:
--------------------------------------------------------------------------------
1 |
170 |
--------------------------------------------------------------------------------