Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brightleaf/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brightleaf/react-hooks - npm Package Compare versions

Comparing version 0.12.1 to 0.13.0

lib/use-keypress.js

8

lib/index.js

@@ -54,2 +54,8 @@ "use strict";

});
Object.defineProperty(exports, "useKeypress", {
enumerable: true,
get: function () {
return _useKeypress.default;
}
});
Object.defineProperty(exports, "useLocalStorage", {

@@ -114,2 +120,4 @@ enumerable: true,

var _useKeypress = _interopRequireDefault(require("./use-keypress"));
var _useLocalStorage = _interopRequireDefault(require("./use-local-storage"));

@@ -116,0 +124,0 @@

5

package.json
{
"name": "@brightleaf/react-hooks",
"version": "0.12.1",
"version": "0.13.0",
"description": "Useful react hooks",

@@ -34,3 +34,4 @@ "files": [

"@hapi/nes": "^11.2.0",
"graphql-request": "^1.8.2"
"graphql-request": "^1.8.2",
"highlight.js": "^9.15.8"
},

@@ -37,0 +38,0 @@ "devDependencies": {

@@ -11,2 +11,3 @@ # Brightleaf React Hooks

* `useGraphQL` - Hook to make a GraphQL request
* `useKeypress` - Hook to Keypress
* `useNes` - Hook to connect to Hapijs NES

@@ -68,3 +69,24 @@ * `useWebSockets` - Hook to interact with WebSockets

```
## Keypress Hook
```jsx
import React from 'react'
import { useKeypress } from '@brightleaf/react-hooks'
export default () => {
const aKeyDown = useKeypress('a')
return (
<div className="App content">
<h2>Key Press?</h2>
{aKeyDown && (
<div>
Yes, the <b>{'"a"'}</b> key is pressed
</div>
)}
{!keyDown && <div>No the <b>{'"a"'}</b> key is not currently pressed</div>}
</div>
)
}
```
## Post Hook

@@ -71,0 +93,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc