MCPcopy Index your code
hub / github.com/bryaneaton13/react-pull-to-refresh

github.com/bryaneaton13/react-pull-to-refresh @v2.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.1 ↗ · + Follow
17 symbols 32 edges 7 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

react-pull-to-refresh

npm install react-pull-to-refresh -S

A pull to refresh component for the web.

Based on Andy Peatling's Pull to Refresh for the Web

Demo GIF

Usage

Your refresh handler function takes in resolve and reject to tell the PullToRefresh component when it's finished.

async handleRefresh() {
  await asyncCode();
}

Where you want to render the component:

<ReactPullToRefresh onRefresh={handleRefresh} className="your-own-class-if-you-want" style={{ textAlign: 'center' }}>
  <h3>Pull down to refresh</h3>


{items}




etc.


</ReactPullToRefresh>

CSS

Use the CSS from the example as a starting point.

All props

export interface ReactPullToRefreshProps extends HTMLAttributes<HTMLDivElement> {
  onRefresh: () => Promise<void>;
  icon?: ReactNode;
  loading?: ReactNode;
  disabled?: boolean;
  distanceToRefresh?: number;
  resistance?: number;
  hammerOptions?: {
    cssProps?: CssProps | undefined;
    domEvents?: boolean | undefined;
    enable?: boolean | ((manager:  HammerManager) => boolean) | undefined;
    preset?: RecognizerTuple[] | undefined;
    touchAction?: string | undefined;
    recognizers?: RecognizerTuple[] | undefined;
    inputClass?: HammerInput | undefined;
    inputTarget?: EventTarget | undefined;
  }
  • onRefresh: () => Promise<void>
  • icon: ReactNode
  • default: html <span className="genericon genericon-next"></span>
  • loading: ReactNode
  • default: ```html

- **disabled**: `boolean` - **className**: `string` - **style**: `object` - **distanceToRefresh**: `number` - _default_: `70` - **resistance**: `number` - _default_: `2.5` - **hammerOptions**: `HammerOptions`typescript interface HammerOptions { cssProps?: CssProps | undefined; domEvents?: boolean | undefined; enable?: boolean | ((manager: HammerManager) => boolean) | undefined; preset?: RecognizerTuple[] | undefined; touchAction?: string | undefined; recognizers?: RecognizerTuple[] | undefined; inputClass?: HammerInput | undefined; inputTarget?: EventTarget | undefined; } ```

Thanks

Andy Peatling

Extension points exported contracts — how you extend this code

ReactPullToRefreshProps (Interface)
(no doc)
src/components/ReactPullToRefresh.tsx

Core symbols most depended-on inside this repo

_setContentPan
called by 2
src/pull-to-refresh/wptr.1.1.ts
_setBodyClass
called by 2
src/pull-to-refresh/wptr.1.1.ts
_doReset
called by 2
src/pull-to-refresh/wptr.1.1.ts
webPullToRefresh
called by 1
src/pull-to-refresh/wptr.1.1.ts
_doLoading
called by 1
src/pull-to-refresh/wptr.1.1.ts
delay
called by 1
playground/main.tsx
ReactPullToRefresh
called by 0
src/components/ReactPullToRefresh.tsx
handleRefresh
called by 0
src/components/ReactPullToRefresh.tsx

Shape

Function 16
Interface 1

Languages

TypeScript100%

Modules by API surface

src/pull-to-refresh/wptr.1.1.ts11 symbols
src/components/ReactPullToRefresh.tsx3 symbols
playground/main.tsx3 symbols

For agents

$ claude mcp add react-pull-to-refresh \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact