mobx-react

    5熱度

    1回答

    我有React/Mobx應用程序。當我在商店中進行更改時,組件正在更新(重新渲染),但我需要進行一些比較以添加更多功能,所以我想使用componentWillReceiveProps(nextProps)並將nextProps與this.props進行比較。不知何故,它不被稱爲。任何想法,我做錯了什麼,或者我可以做什麼,爲了得到它?

    0熱度

    1回答

    我一直把我的auth.onAuthStateChange().then(user => ...放在頂層React組件的componentDidMount()之內。 然後我會刪除的componentWillUnmount() 內監聽我的問題是如何將我mobx-IFY呢?我的想法是這樣的: class Store { @observable user = null @action

    3熱度

    1回答

    我Store.js時: import { observable, useStrict, action } from 'mobx'; useStrict(true); export const state = observable({ contacts: [] }); export const actions = { addContact: action((f

    1熱度

    1回答

    給出以下內容; let render =() => { const routes = require('./routes/index').default(store) ReactDOM.render( <AppContainer store={store} routes={routes} />, MOUNT_NODE ) } // ==========

    1熱度

    2回答

    我struggeling設置我的項目正確useStrict(true) 錯誤 mobx.module.js:2238 Uncaught (in promise) Error: [mobx] Invariant failed: Since strict-mode is enabled, changing observed observable values outside actions is no

    0熱度

    1回答

    與MobX反應(來自create-react-app)。使用axios進行異步後端API調用。 此代碼有效。初始狀態(問題陣列)已填充,呈現此組件的網頁呈現來自狀態的初始內容。 import { observable, computed, autorun, reaction } from 'mobx' import axios from 'axios' class IssuesStore {

    0熱度

    1回答

    我有下面的類 export default class BaseStore { @observable model ; @action updateStore(propertyName, newValue) { this.model[propertyName] = newValue; } } 子類中我添加圖層到觀察的模型,如MobX觀察到: mode

    0熱度

    1回答

    class Someclass { @observable waiting = false; @observable error = null; @action.bound async authenticate({login, password}) { try { this.waiting = true; const re

    0熱度

    1回答

    我一直在尋找一個輸入字段MOBX驗證,但我還沒有能夠找到的任何東西,我發現「MobX輸入」這需要一個形式,但我沒有任何形式的。另外一個,我發現了「mobx反應的形式」用ValidatorJs其中再次使用形式。任何提示或示例將不勝感激。我只是想能夠在普通輸入字段上使用它 <Input placeholder="FirstName" type="text" defaultValue={Contact

    1熱度

    1回答

    的要求是: 當用戶改變在DayView分量輸入,在這一天實例移位的數目被改變爲輸入值(即4在輸入裝置day.shifts.length == 4) 時day.shifts變化,然後使DayView.renderShifts N行要被渲染 但是,改變輸入值的作品,但DayView.render只被調用一次。它應該在一天之後再次呼叫。換擋被改變。 我缺少什麼? 這裏是我的觀察員組件: //App.js