-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update map and x-section to use @observer
Since these components are passed an observable array, they won't re-render automatically when the array's internals update, and instead only re-render when a primitive value updates. This means that their rendering is always a step behind in the simulation. This makes the less pure-componenty, but seems to be the recommended way. See: mobxjs/mobx-state-tree#1060 https://github.com/mobxjs/mobx-react#faq mobxjs/mobx#101 An alternative would be to use `getSnapshot(data)`, but this is claimed to be less efficient. (Untested, and perhaps for our use-case is negligible and the cleaner code would be preferred.)
- Loading branch information
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters