0.1.1 • Published 1 year ago

@rapper3/react-ahooks v0.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

@rapper3/react-ahooks

Based on ahooks

Usage

1. Generate TS code in your project firstly

2. Then install @rapper3/react-ahooks

yarn add @rapper3/react-ahooks ahooks

Or

npm i @rapper3/request @rapper3/react-ahooks ahooks

3. useHttp

import { useHttp } from 'src/rapper';
function App() {
  const { data, loading, refresh } = useHttp('POST/user/info/header', {
    token: 'token',
    name: 'name222',
  });
  return <>{loading ? <p>loading...</p> : data ? <p>{data}</p> : <p>No Data</p>}</>;
}

More details: Rapper react hooks