mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-17 12:07:09 +00:00
WA-238 Create openHoc component using withStateHandlers
This commit is contained in:
parent
9904e1b12e
commit
b7d4944b01
12
src/components/hoc/OpenHoc.jsx
Normal file
12
src/components/hoc/OpenHoc.jsx
Normal file
@ -0,0 +1,12 @@
|
||||
// @flow
|
||||
import { withStateHandlers } from 'recompose'
|
||||
|
||||
export type Open = {
|
||||
open: boolean,
|
||||
toggle: () => void,
|
||||
}
|
||||
|
||||
export default withStateHandlers(
|
||||
() => ({ open: false }),
|
||||
{ toggle: ({ open }) => () => ({ open: !open }) },
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user