-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow][libdef] Update typing for
React.Context
to align with React …
…19 changes Summary: In React 19, created react context `MyContext` can be used in places that expects `MyContext.Provider`. This diff updates the libdef to support that. This is implemented as an intersection type behind an opaque type. Close #9245 Changelog: [lib] Type for `React.Context` has been updated to support [React 19's context as provider model](https://react.dev/blog/2024/12/05/react-19#context-as-a-provider). Given this change, you might need additional annotations on exports. e.g. ``` const Context: React.Context<Foo> = React.createContext(...); export const MyProvider = Context.Provider; // ^ annotation now required ``` Reviewed By: alexmckenley Differential Revision: D67993213 fbshipit-source-id: cb717f4449a39d8614143f84e11990704462b6f4
- Loading branch information
1 parent
10f17c1
commit 0d9ba1a
Showing
16 changed files
with
308 additions
and
304 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
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
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
Oops, something went wrong.