@edvnz/refresh-control

1.0.2 • Public • Published

Refresh Control

Installation

To install the BottomSheet component, run the following command:

$ npm install @edvnz/refresh-control
# or
$ yarn add @edvnz/refresh-control

Usage

import { RefreshControl } from '@edvnz/refreshControl'


const Component = () => {
  const [refreshing, setRefreshing] = useState(false)

  const wait = (timeout) => {
    return new Promise((resolve) => setTimeout(resolve, timeout))
  }

  const onRefresh = () => {
    setRefreshing(true)
    wait(2000).then(() => setRefreshing(false))
  }

  return (
    <ScrollView
      contentContainerStyle={{ flexGrow: 1 }}
      showsVerticalScrollIndicator={false}
      refreshControl={
        <RefreshControl
          refreshing={refreshing}
          onRefresh={onRefresh}
          tintColor={colors.primary}
          size={20}
        />
      }
    >
      {...}
    </ScrollView>
  )
}

Props

Prop name Type Description
refreshing boolean

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @edvnz/refresh-control

    Weekly Downloads

    0

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    13.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • jeyabaskar
    • gmvarun
    • yokesh_ks