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

react-use-hash-key

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-hash-key

Generate unique key for many components.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-use-hash-key

Installation

npm install react-use-hash-key
yarn add react-use-hash-key

Usage

import {useHashKey} from 'react-use-hash-key';

const obj = [
    {
        id: "1",
        title: "My title"
    },
    {
        id: 2,
        title: "My title"
    },
]

function Component1() {
  return obj.map(ent => <MyComponent key={useHashKey(ent.id)} />)
}

function Component2() {
  return obj.map(ent => <MyComponent key={useHashKey(ent.title)} />)
}

Keywords

react

FAQs

Package last updated on 15 Nov 2022

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