Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bdbch/react-devto
Dev.to API hooks for React.js
https://github.com/bdbch/react-devto
api devto hooks react react-hooks
Last synced: 4 months ago
JSON representation
Dev.to API hooks for React.js
- Host: GitHub
- URL: https://github.com/bdbch/react-devto
- Owner: bdbch
- License: mit
- Created: 2019-07-20T10:32:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-09T21:24:29.000Z (over 4 years ago)
- Last Synced: 2024-04-26T08:04:34.186Z (10 months ago)
- Topics: api, devto, hooks, react, react-hooks
- Language: TypeScript
- Homepage: https://bdbch.github.io/react-devto/
- Size: 1.1 MB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-react-hooks - `@d2k/react-devto`
- awesome-react-hooks-cn - `@d2k/react-devto`
- awesome-react-hooks - `@d2k/react-devto`
- awesome-react-hooks - `@d2k/react-devto`
README
# `@d2k/react-devto`
> React hooks for Dev.to integrations
> You'll need to install `react`, `react-dom`, etc at `^16.8.4`
* [Demo](https://bdbch.github.io/react-devto/)
## Install
```sh
npm i @d2k/react-devto --save
```# Usage
```js
import {
useArticles,
useFollowSuggestions,
useTags,
useUser
} from "@d2k/react-devto";const MyComponent = () => {
// useArticles(page, tag, username)
const { articles, loading, error } = useArticles();// useFollowSuggestions()
const { suggestions, loading, error } = useFollowSuggestions();// useTags(page)
const { tags, loading, error } = useTags();// useUser(username, id)
const { user, loading, error } = useUser("bdbch");
};
```