The problem of introducing mobx into react

  1. how to design store in mobx? If you use mobx, do you want to use react"s state? or not?
  2. write the operation of the form, make changes when each field needs to add a change method, feel more tedious, is there a better way?
  3. can you provide some mobx best practices in your project?
Feb.21,2022

you can probably give up these ( mobx , redux ).

local state can be implemented with state .

global, such as login information, topics, etc., can be implemented

with context . The

question says that "each field needs to add a change method", which can be implemented in the following ways

//
set = (type) => (ev) => {
    this.setState({
        [type]:ev.target.value
    })
}
//...
<input onchange={this.set('name')} />
<input onchange={this.set('age')} />
<input onchange={this.set('loaction')} />
<input onchange={this.set('company')} />
....
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c32d-2b272.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c32d-2b272.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?