1.0.26 • Published 1 year ago

@eitje/react-hooks v1.0.26

Weekly downloads
9
License
ISC
Repository
github
Last release
1 year ago

react-hooks

Hooks to make life easy

Three hooks currently being exported:

useAsyncEffect

use async functions inside an effect

example:

useAsyncEffect(
  async () => {
    const data = await getData
    console.log(data)    
  }, [] ) 

usePrevious

get previously rendered value of a ref or state value.

example:

const [myState, setState] = useState(0)
const prevState = usePrevious(myState)

setState(myState + 1)

myState => 1
prevState => 0

useMergeState

Classic class component setState merging behaviour. Usage exactly same as useState

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.20

2 years ago

1.0.16

3 years ago

1.0.11

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.2

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago