Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Get rid of the suppressChangedStoreWarning flag leftovers #742

Merged
merged 2 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Notes:

- It is possible to read the stores provided by `Provider` using `React.useContext`, by using the `MobXProviderContext` context that can be imported from `mobx-react`.
- If a component asks for a store and receives a store via a property with the same name, the property takes precedence. Use this to your advantage when testing!
- Values provided through `Provider` should be final, to avoid issues like mentioned in [React #2517](https://github.com/facebook/react/issues/2517) and [React #3973](https://github.com/facebook/react/pull/3973), where optimizations might stop the propagation of new context. Instead, make sure that if you put things in `context` that might change over time, that they are `@observable` or provide some other means to listen to changes, like callbacks. However, if your stores will change over time, like an observable value of another store, MobX will warn you. To suppress that warning explicitly, you can use `suppressChangedStoreWarning={true}` as a prop at your own risk.
- Values provided through `Provider` should be final. Make sure that if you put things in `context` that might change over time, that they are `@observable` or provide some other means to listen to changes, like callbacks. However, if your stores will change over time, like an observable value of another store, MobX will throw an error.
- When using both `@inject` and `@observer`, make sure to apply them in the correct order: `observer` should be the inner decorator, `inject` the outer. There might be additional decorators in between.
- The original component wrapped by `inject` is available as the `wrappedComponent` property of the created higher order component.

Expand Down
2 changes: 1 addition & 1 deletion src/Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ function grabStores(from) {
}

function validStoreName(key) {
return !specialReactKeys[key] && key !== "suppressChangedStoreWarning"
return !specialReactKeys[key]
}