Skip to content

Commit 2be3ae1

Browse files
Jessica Caofacebook-github-bot
Jessica Cao
authored andcommitted
Add ?Fbt to flow type for the title & message props
Differential Revision: D6253195 fbshipit-source-id: eadb185eacdf341393d73357beab22bed1d0169e
1 parent 515eb0e commit 2be3ae1

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Libraries/Alert/Alert.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const NativeModules = require('NativeModules');
1616
const Platform = require('Platform');
1717

1818
import type { AlertType, AlertButtonStyle } from 'AlertIOS';
19+
import type { Fbt } from 'fbt';
1920

2021
export type Buttons = Array<{
2122
text?: string,
@@ -79,8 +80,8 @@ type Options = {
7980
class Alert {
8081

8182
static alert(
82-
title: ?string,
83-
message?: ?string,
83+
title: ?string | ?Fbt,
84+
message?: ?string | ?Fbt,
8485
buttons?: Buttons,
8586
options?: Options,
8687
type?: AlertType,
@@ -104,8 +105,8 @@ class Alert {
104105
class AlertAndroid {
105106

106107
static alert(
107-
title: ?string,
108-
message?: ?string,
108+
title: ?string | ?Fbt,
109+
message?: ?string | ?Fbt,
109110
buttons?: Buttons,
110111
options?: Options,
111112
): void {

Libraries/Alert/AlertIOS.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
*/
1313
'use strict';
1414

15-
var RCTAlertManager = require('NativeModules').AlertManager;
15+
const RCTAlertManager = require('NativeModules').AlertManager;
16+
17+
import type { Fbt } from 'fbt';
1618

1719
/**
1820
* An Alert button type
@@ -133,8 +135,8 @@ class AlertIOS {
133135
* );
134136
*/
135137
static alert(
136-
title: ?string,
137-
message?: ?string,
138+
title: ?string | ?Fbt,
139+
message?: ?string | ?Fbt,
138140
callbackOrButtons?: ?(() => void) | ButtonsArray,
139141
type?: AlertType,
140142
): void {
@@ -192,8 +194,8 @@ class AlertIOS {
192194
* );
193195
*/
194196
static prompt(
195-
title: ?string,
196-
message?: ?string,
197+
title: ?string | ?Fbt,
198+
message?: ?string | ?Fbt,
197199
callbackOrButtons?: ?((text: string) => void) | ButtonsArray,
198200
type?: ?AlertType = 'plain-text',
199201
defaultValue?: string,

0 commit comments

Comments
 (0)