Skip to content

Commit

Permalink
Add missing constants to fallback implementation of ToastAndroid (#38803
Browse files Browse the repository at this point in the history
)

Summary:
Pull Request resolved: #38803

The d.ts file says these constant must exist, but they only exist in the android implementation. This diff stops lying and adds some dummy constants, so that the type will match-up.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D48085126

fbshipit-source-id: 8d5332a71b9b3c1925abeec9e47630a07abf8b86
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Aug 8, 2023
1 parent 2bf59c7 commit c0c4507
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @noflow
* @flow strict-local
*/

'use strict';

const ToastAndroid = {
// Dummy fallback toast duration constants
SHORT: (0: number),
LONG: (0: number),
// Dummy fallback toast gravity constants
TOP: (0: number),
BOTTOM: (0: number),
CENTER: (0: number),

show: function (message: string, duration: number): void {
console.warn('ToastAndroid is not supported on this platform.');
},
Expand Down

0 comments on commit c0c4507

Please sign in to comment.