question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export createBottomSheetScrollableComponent

See original GitHub issue

Feature Request

Why it is needed

With the new FlashList from shopify, it would be great to be able to use it with BottomSheet. For that I propose to export createBottomSheetScrollableComponent, so a -BottomSheetFlashList- can be build

I have a really big FlatList inside a BottomSheet, that has infinitive scrolling. It would be great to get the performance boost from FlashList

Possible implementation

I guess it would be straight forward to export createBottomSheetScrollableComponent. Perhaps it should be mentioned in the docs, that the component needs to be memoized as well.

Code sample

const BottomSheetFlashListComponent = createBottomSheetScrollableComponent<
  BottomSheetFlatListMethods,
  BottomSheetFlatListProps<any>
>(SCROLLABLE_TYPE.FLATLIST, AnimatedFlashList);

const BottomSheetFlashList = memo(BottomSheetFlashListComponent);

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

6reactions
BalogunofAfricacommented, Jul 26, 2022

Pending when the implementation is available publicly, you can pass BottomSheetScrollView to renderScrollComponent in your FlashList rendered in a BottomSheet. This prop is the same as the externalScrollView of RecyclerListView.

import { BottomSheetScrollView } from "@gorhom/bottom-sheet";
...
...
...
<BottomSheet>
    ....
    <FlashList
        ...
        renderScrollComponent={BottomSheetScrollView}
        ...
        />
    ...
</BottomSheet>
1reaction
RichardLindhoutcommented, Jul 23, 2022

This works for me

import * as React from 'react';
import { FlashList, FlashListProps } from '@shopify/flash-list';

import Animated from 'react-native-reanimated';
import {
  BottomSheetFlatList as BSF,
  createBottomSheetScrollableComponent,
  SCROLLABLE_TYPE,
} from '@gorhom/bottom-sheet';

const F2 = React.forwardRef((props: any, ref) => {
  return (
    <FlashList
      {...props}
      overrideProps={{
        ref,
      }}
    />
  );
});

const AnimatedFlashList = Animated.createAnimatedComponent<FlashListProps<any>>(
  F2 as any,
);

const BottomSheetFlatListComponent = createBottomSheetScrollableComponent(
  SCROLLABLE_TYPE.FLATLIST,
  AnimatedFlashList,
);

const BottomSheetFlatList = React.memo(BottomSheetFlatListComponent);
BottomSheetFlatList.displayName = 'BottomSheetFlatList';

export default BottomSheetFlatList as typeof BSF;


Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot re-export a type when using the --isolatedModules ...
TS 3.8+. You can use type-only imports and exports with --isolatedModules : // types.ts export type MyType = { a: string; b: number;...
Read more >
gorhom/bottom-sheet - npm
A performant interactive bottom sheet with fully configurable options . Latest version: 4.4.5, last published: 3 months ago.
Read more >
[sentinelone] HermeticWiper | New Destructive Malware Used In ...
Export createBottomSheetScrollableComponent, 5, 2022-06-30, 2022-08-24. querylog_interval not work, 2, 2021-10-29, 2022-07-14.
Read more >
export to expose all used classes - Turms-Im/Turms - IssueHint
export to expose all used classes. ... Export createBottomSheetScrollableComponent, 5, 2022-06-30, 2022-10-09. Integration with MacOS share menu.
Read more >
React Export Guide — Step by Step | by Juan Maguid - Medium
How to export to React. Follow these instructions to the point and you'll be exporting to React code and components in super little...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found