diff --git a/README.md b/README.md index fc259794..3ad15e1d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/Provider.js b/src/Provider.js index 1206eb8c..2c6984ea 100644 --- a/src/Provider.js +++ b/src/Provider.js @@ -45,5 +45,5 @@ function grabStores(from) { } function validStoreName(key) { - return !specialReactKeys[key] && key !== "suppressChangedStoreWarning" + return !specialReactKeys[key] }