Skip to content

ustccjw/immutable-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

immutable-component

immutable-component to make state immutable

Usage

this.setState({
    'a.b': 1
})
// or 
this.setState(prevState => {
    prevState.a.b = 1
})

// Either return a new value *or* modify the draft
this.setState(prevState => {
    // prevState.a.b.c = 1
    return { a: { b: 1 } }
})

About

immutable-component to make state immutable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published