1.0.26 • Published 1 month ago

@eitje/react-hooks v1.0.26

Weekly downloads
9
License
ISC
Repository
github
Last release
1 month 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 month ago

1.0.25

1 month ago

1.0.24

2 months ago

1.0.23

2 months ago

1.0.22

4 months ago

1.0.21

4 months ago

1.0.19

7 months ago

1.0.18

7 months ago

1.0.17

7 months ago

1.0.20

7 months ago

1.0.16

2 years ago

1.0.11

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.2

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago