Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ttoss/hooks

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ttoss/hooks

React hooks.

latest
npmnpm
Version
1.21.13
Version published
Maintainers
2
Created
Source

@ttoss/hooks

📚 About

@ttoss/hooks is a easiest way to use Util Hooks in your React application.

🚀 Getting Started

Install @ttoss/hooks

$ yarn add @ttoss/hooks
# or
$ npm install @ttoss/hooks

📄 Examples of use

import React from "react";

import { useScript } from "@ttoss/hooks";

export const Component = () => {
  const url = "https://your-domain.com/bundle-api.js";

  const { status } = useScript(url);

  return <div>{status === "ready" ? "Ok" : "Loading"}</div>;
};

📘 Types

type ScriptStatus = "idle" | "loading" | "ready" | "error";

const useScript: (src: string) => {
  status: ScriptStatus;
};

Keywords

React

FAQs

Package last updated on 05 Apr 2023

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