-
Mobx uses how to initialize store?
how does mobx initialize store, because I want to get the data from the background, but in some components, how do I initialize it in store? do I new, in the root node of the project, app.jsx, and then call mobx s action? ...
-
React uses the switch component in the table of ant design, but the switch data is not updated?
use the original table component to encapsulate an extra layer of TableC, in the render method of the columns property to render switch, circularly. No matter how you modify the data view, it will not be updated, including using mobx, to ask how to solv...
-
Management of whether ui components are visible in mobx?
there is a problem with using mobx:
obtain the backend interface data through @ action, then assign a value to @ observable data, and then calculate whether the modal needs to be displayed from data through @ computed modalVisiable. How can I change t...
-
About the problem of Mobx inject passing value?
according to the documentation, Mobx, wants to get and call parameters in the form of inject in the sub-component, but there is a undefined problem?
Timer.ts
interface IProps {
timerStore?: TimerStore;
}
interface State {}
inject( timerStore ...
-
The computed property in Mobx cannot be triggered.
1. Using computed in mobx does not work
class ODOM {
constructor(props) {
console.log( how many times )
}
@observable speed = 0
@action change(obj) {
console.log(obj)
Object.keys(obj).forEach(item => {
this[item] = obj[it...
-
Is it normal for mobx to modify @ observable with ES6's setter stored value function?
I tried normal and effective in non-strict mode ...
-
Query on the effect of Shuttle frame realized by mobx + react
I have two table components of antd, and to achieve the shuttling box effect on them, I now have two ideas to waver!
1. Create a parent store (mobx), with two table components whose store inherits its array
2. In the array used by the two table comp...
-
Can the value of Mobx @ observable be a Set () of ES6?
@observable selectedRowsSet = new Set()...
-
How do I ensure that an action is performed after the view is updated in mobx?
The setState ({}, () = > {.}) function in react, and the second parameter callback function executes after the view is refreshed.
but when using mobx, as shown above, how does this.commentsNum--, ensure that console? is executed after the view is r...
-
Undefined occurs when using mobx
problem description
define an attribute such as page,pageSize in store to do paging. Then in the component, click the paging callback and call acttion to modify the corresponding page and pageSzie, but undefined appears.
related codes
store
*...
-
Project creation for react+webpack+mobx
problem description
in the process of creating a project, the decorator syntax always indicates that it cannot be parsed
what methods have you tried
found a lot of configuration methods for supporting modifiers on the Internet, and there are a lot...
-
How to write a react state management framework?
as the title
in fact, there are two major problems that need to be solved:
1. Extract the data into store and monitor the data. You can use Object.defineProperties or Proxy
2. You need to notify the component to update if the data chang...
-
React mobx error Missing class properties transform
1 react mobx project execution will report an error react mobx error Missing class properties transform, has installed transform-decorators-legacy and transform-class-properties, I don t know what went wrong
store countStore.js
import { observable, ...
-
The problem with react mobx using decorator has been resolved (resolved)
babel-plugin-transform-decorators-legacy is installed and error message is configured in .babelrc
store countStore.js
import { observable, action, computed, runInAction, autorun, extendObservable } from mobx ;
class CountStore {
@observable...
-
After the react form is deleted, the value of value is moved to the next input
problem description
using the project written by react and mbox, I made the form control into a component and then looped through the parent component, which can be edited or deleted after being added. Now there is a problem. After adding multiple ent...
-
How to get routing information in react-mobx?
how do I get routing information for react-router4 in store? ...
-
[ES6 Class function] how do subclasses modify parent class attribute values?
related codes
class BaseStore {
@observable statusTabActiveKey = 0
}
class ListStore extends BaseStore {
@action.bound
handleTabChange(index) {
super.statusTabActiveKey = index
}
}
const baseStore = new BaseStore()
const listS...
-
When strict mode is enabled in mobx, an error is reported in the modified value in action, which is blocked.
A simple store, login, logout, and access to users in the current session
class UserStore {
@observable
detail = {};
@observable
userInfoId;
@observable
nickName;
@action
doLogin = (data) => {
const _this ...
-
The problem of introducing mobx into react
how to design store in mobx? If you use mobx, do you want to use react s state? or not?
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?
can you provide some mobx ...
-
Mobx,redux, these problems of dividing store
has found a lot of information, and it seems that the division of store is recommended for flattening. Up to two layers, such as
{
home:homeStore,
about:aboutStore
}
so what about the above structure for complex pages? Like ho...