mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix: unified Share Action types (#38351)
Summary: This pull request simplifies the type and fixes a TypeScript object destructuring problem by combining the ShareSharedAction and ShareDismissedAction types into a single ShareAction type. Enabling proper access to the activityType property without TypeScript errors. ## Changelog: [INTERNAL] [FIXED] - Unified ShareSharedAction and ShareDismissedAction into ShareAction. Resolved TypeScript issue with object destructuring. Pull Request resolved: https://github.com/facebook/react-native/pull/38351 Test Plan: With the current typing:  With the proposed solution:  Reviewed By: NickGerleman Differential Revision: D47527426 Pulled By: philIip fbshipit-source-id: 9830cd993596bbac2dc07d9f37ca20b35f582156
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2669f8c384
commit
caa8dbf0e9
+3
-9
@@ -27,17 +27,11 @@ export type ShareOptions = {
|
||||
anchor?: number | undefined;
|
||||
};
|
||||
|
||||
export type ShareSharedAction = {
|
||||
action: 'sharedAction';
|
||||
activityType?: string | undefined;
|
||||
export type ShareAction = {
|
||||
action: 'sharedAction' | 'dismissedAction';
|
||||
activityType?: string | null | undefined;
|
||||
};
|
||||
|
||||
export type ShareDismissedAction = {
|
||||
action: 'dismissedAction';
|
||||
};
|
||||
|
||||
export type ShareAction = ShareSharedAction | ShareDismissedAction;
|
||||
|
||||
export interface ShareStatic {
|
||||
/**
|
||||
* Open a dialog to share text content.
|
||||
|
||||
@@ -84,8 +84,7 @@ import {
|
||||
SectionListProps,
|
||||
SectionListRenderItemInfo,
|
||||
Share,
|
||||
ShareDismissedAction,
|
||||
ShareSharedAction,
|
||||
ShareAction,
|
||||
StatusBar,
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
|
||||
Reference in New Issue
Block a user