DEV Community

vigneshiyergithub
vigneshiyergithub

Posted on

React custom hook npm package to fetch Dev.to blogs

Introduction

I wrote a React custom hook to fetch dev.to blogs. This hook was inspired when I was trying to integrate dev.to blogs to my personal portfolio website

Installation

yarn add dev-to-blogs-hook
npm i dev-to-blogs-hook
Enter fullscreen mode Exit fullscreen mode

Usage

The hook provides 3 params : blogs, fetching , error

import { useDevToBlogs } from "dev-to-blogs-hook";

const { blogs, fetching, error } = useDevToBlogs({userName : 'devToUserName'})
Enter fullscreen mode Exit fullscreen mode

Conclusion

A simple react hook to integrate with your React apps.

Top comments (1)

Collapse
 
ecyrbe profile image
ecyrbe

For more options you can also take a look at my example with zodios library and combine it with @zodios/react