3.1.0 • Published 4 years ago

@kalleguld/react-props v3.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

react-props

A slightly better way of managing state in react.

Start by calling const p = useProp('asdf'), which returns a Prop<string>. Pass the prop to an <Input> with <Input prop={p}>.

Use map() to "slice" a big Prop into smaller pieces for easier consumption:

const person = useProp({
    name: "Santa Claus",
    email: "santa@northpole.net",
    socialMedia: {
        instagram: "theRealSanta",
        youtube: "@santa1",
    }
    isWatching: true
});

const name = map(person, 'name');
const email = map(person, 'email');
const youtube = map(person, 'socialMedia','youtube'):
2.2.0

4 years ago

2.1.1

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

3.1.0

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.10

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago