Skip to content

Commit 45ed142

Browse files
Adriano Melofacebook-github-bot
Adriano Melo
authored andcommitted
Docs: Improve BackHandler documentation (addEventListener and removeEventListener)
Summary: This commit adds documentation to two methods of BackHandler API, addEventListener and removeEventListener. Despite being a simple change, it helps to keep the documentation consistent. I have tested the `./website` locally, the changes look similar to some other components such as `NetInfo`. [DOCS][ENHANCEMENT][BackHandler] - Improve BackHandler documentation (addEventListener and removeEventListener) Closes #16618 Differential Revision: D6260935 Pulled By: hramos fbshipit-source-id: ab04a9fca89ddaa1925844b5754caf1c355a9329
1 parent de3976a commit 45ed142

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Libraries/Utilities/BackHandler.android.js

+9
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ var BackHandler = {
7474
DeviceEventManager.invokeDefaultBackPressHandler();
7575
},
7676

77+
/**
78+
* Adds an event handler. Supported events:
79+
*
80+
* - `hardwareBackPress`: Fires when the Android hardware back button is pressed or when the
81+
* tvOS menu button is pressed.
82+
*/
7783
addEventListener: function (
7884
eventName: BackPressEventName,
7985
handler: Function
@@ -84,6 +90,9 @@ var BackHandler = {
8490
};
8591
},
8692

93+
/**
94+
* Removes the event handler.
95+
*/
8796
removeEventListener: function(
8897
eventName: BackPressEventName,
8998
handler: Function

0 commit comments

Comments
 (0)