React Devto: The Ultimate Dev.to API Hooks Library for React.js

@d2k/react-devto

React hooks for Dev.to integrations

You'll need to install react, react-dom, etc at ^16.8.4

Install

npm i @d2k/react-devto --save

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");
};

.editorconfig

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
root = true
trim_trailing_whitespace = true

.gitignore

node_modules
*.log
dist

Download details:

Author:  bdbch
Source: https://github.com/bdbch/react-devto

License: MIT license

#reacthook #react #javascript 

React Devto: The Ultimate Dev.to API Hooks Library for React.js
1.30 GEEK