Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TranslationProvider [nfc]: Annotate
TranslationContext
.
Despite passing `undefined` as the `defaultValue` argument to `React.createContext`, consumers will never see `undefined` as the value for `this.context` or `useContext(TranslationContext)`. That is, as long as `TranslationContext.Provider` is above such consumers in the component hierarchy. From React's doc on `createContext` [1], """ The `defaultValue` argument is **only** used when a component does not have a matching Provider above it in the tree. This can be helpful for testing components in isolation without wrapping them. """ Adding this annotation will satisfy the new version of Flow (0.122.0) that we'll get along with the React Native v0.63 upgrade (zulip#4245) soon. [1] https://reactjs.org/docs/context.html#reactcreatecontext
- Loading branch information