Skip to content

Commit

Permalink
Fix up NativeDialogManagerAndroid PR
Browse files Browse the repository at this point in the history
Summary:
This diff has three changes:
1. Remove all references to `Stringish` from `NativeDialogManagerAndroid`. (All Fbt objects expose a `.toString` method we could call).
2. Make sure that we only access `DialogManagerAndroid` through `NativeDialogManagerAndroid`.
3. Removed a bunch of `$FlowFixMes` in the files I touched. Probably not the best idea to bite into this cleanup on this diff, but what's done is done.

Since this diff is fairly large, I've commented on parts of it I thought were note-worthy. I've also commented on the changes I had to make to fix flow after removing the `$FlowFixMe`s.

Reviewed By: PeteTheHeat

Differential Revision: D16428855

fbshipit-source-id: 0e6daf2957f4b086ebb1e78e0a59930668c65576
  • Loading branch information
RSNara authored and facebook-github-bot committed Aug 5, 2019
1 parent 3eaf245 commit a5b925d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,10 @@ namespace JS {
namespace NativeDialogManagerAndroid {
struct DialogOptions {
NSString *title() const;
id<NSObject> _Nullable message() const;
id<NSObject> _Nullable buttonPositive() const;
id<NSObject> _Nullable buttonNegative() const;
id<NSObject> _Nullable buttonNeutral() const;
NSString *message() const;
NSString *buttonPositive() const;
NSString *buttonNegative() const;
NSString *buttonNeutral() const;
folly::Optional<facebook::react::LazyVector<NSString *>> items() const;
folly::Optional<bool> cancelable() const;

Expand Down Expand Up @@ -2463,25 +2463,25 @@ inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::title() const
id const p = _v[@"title"];
return RCTBridgingToString(p);
}
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::message() const
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::message() const
{
id const p = _v[@"message"];
return p;
return RCTBridgingToString(p);
}
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::buttonPositive() const
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::buttonPositive() const
{
id const p = _v[@"buttonPositive"];
return p;
return RCTBridgingToString(p);
}
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::buttonNegative() const
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::buttonNegative() const
{
id const p = _v[@"buttonNegative"];
return p;
return RCTBridgingToString(p);
}
inline id<NSObject> _Nullable JS::NativeDialogManagerAndroid::DialogOptions::buttonNeutral() const
inline NSString *JS::NativeDialogManagerAndroid::DialogOptions::buttonNeutral() const
{
id const p = _v[@"buttonNeutral"];
return p;
return RCTBridgingToString(p);
}
inline folly::Optional<facebook::react::LazyVector<NSString *>> JS::NativeDialogManagerAndroid::DialogOptions::items() const
{
Expand Down
8 changes: 4 additions & 4 deletions Libraries/NativeModules/specs/NativeDialogManagerAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ type DialogAction = string;
type DialogButtonKey = number;
export type DialogOptions = {|
title?: string,
message?: Stringish,
buttonPositive?: Stringish,
buttonNegative?: Stringish,
buttonNeutral?: Stringish,
message?: string,
buttonPositive?: string,
buttonNegative?: string,
buttonNeutral?: string,
items?: Array<string>,
cancelable?: boolean,
|};
Expand Down

0 comments on commit a5b925d

Please sign in to comment.