New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-drawers

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-drawers - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

# Version 1.4.0
24th August 2020
* **New features**
* Added hooks to programmatically control drawers
* **Fixes**
* Fixed Layout.Switch: in some situations it could state a drawer is open even if it is closed
# Version 1.3.0

@@ -2,0 +11,0 @@ 24th August 2020

2

package.json
{
"name": "react-drawers",
"version": "1.3.0",
"version": "1.4.0",
"description": "Collapsible docked panels for React",

@@ -5,0 +5,0 @@ "author": "osioalberto@gmail.com",

@@ -189,4 +189,24 @@ # react-drawers

### Programmatic control of drawers
Starting from version 1.4.0, it is possible to use some hooks to programmatically control drawers, like in the following example
```jsx
import { useLeftDrawer } from "react-drawers"
const MyComponent = () => {
const { close } = useLeftDrawer()
return (
<button type="button" onClick={() => close()}>Close left drawer</button>
)
}
```
There are four hooks (one for each drawer): `useTopDrawer`, `useRightDrawer`, `useBottomDrawer` and `useLeftDrawer`. All of them have the same return value, which consists of a JavaScript object with the following properties
- `open`, function to force the drawer to open
- `close`, function to force the drawer to close
- `toggle`, function to toggle the drawer
- `isOpen`, boolean that states if the drawer is open or closed
## License
MIT © [Inmagik s.r.l.](https://github.com/inmagik)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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