react-devto: React Hooks for Dev.to

bdbchgg

bdbch

Posted on July 22, 2019

react-devto: React Hooks for Dev.to

Hello dear dev.to community!

A few days ago I pushed my React hooks library for dev.to which can be used to fetch articles and user information.

You can find it over here.

Demo

Installation

npm i @d2k/react-devto --save
Enter fullscreen mode Exit fullscreen mode

Usage:

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");
};
Enter fullscreen mode Exit fullscreen mode
๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
bdbchgg
bdbch

Posted on July 22, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

ยฉ TheLazy.dev

About