[help] update/mutate State on click option
RanaivosonHerimanitra opened this issue · 2 comments
RanaivosonHerimanitra commented
I'm trying to modify a specific book's shelf whenever an option tag is selected:
The above code calls a custom props
from a component ListBooks
that looks like the following:
<ListBooks onChangeShelf={this.addTo} books ={this.state.books}/>
where addTo
is a function which accepts 02 string inputs and is supposed to mutate my state:
Issue: not sure that $set
mutates my array according to log
PS: I'm using immutability-helper
from npm
Any Hints?
A React Nano Student
DDDDDanica commented
There's an 'update' function in BookAPI to use?
RanaivosonHerimanitra commented
Yeah, solved it ;)