New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@dhruv-m-patel/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhruv-m-patel/react-hooks

A library of custom react hooks for frontend projects

latest
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

@dhruv-m-patel/react-hooks

A library of custom react hooks for frontend projects

CI Status

Using this package

  • Install this package

    npm i -S @dhruv-m-patel/react-hooks
    # OR
    yarn add @dhruv-m-patel/react-hooks
    
  • Import custom hook from this package and use it in your component

    import * as React from 'react';
    import { useFetch } from '@dhruv-m-patel/react-hooks';
    import { Text } from '@dhruv-m-patel/react-components';
    
    export default function MyAwesomeComponent({ apiEndpoint }) {
      const { loading, error, data } = useFetch(apiEndpoint);
    
      if (loading) {
        return (
          <Text>Loading data....</Text>
        );
      }
    
      if (error) {
        return (
          <Text>Oops, There was an error fetching data!</Text>
        );
      }
    
      return (
        <Text>{JSON.stringify(data)}</Text>
      );
    }
    

Keywords

react

FAQs

Package last updated on 11 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts