mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-05 03:09:23 +00:00
[fix] Reintroduce BackHandler with console.error
This API will be removed in a future version.
This commit is contained in:
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
AppRegistry: true,
|
AppRegistry: true,
|
||||||
AppState: true,
|
AppState: true,
|
||||||
Appearance: true,
|
Appearance: true,
|
||||||
|
BackHandler: true,
|
||||||
Button: true,
|
Button: true,
|
||||||
CheckBox: true,
|
CheckBox: true,
|
||||||
Clipboard: true,
|
Clipboard: true,
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Nicolas Gallagher.
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
* @flow
|
||||||
|
*/
|
||||||
|
|
||||||
|
function emptyFunction() {}
|
||||||
|
|
||||||
|
const BackHandler = {
|
||||||
|
exitApp: emptyFunction,
|
||||||
|
addEventListener(): {| remove: () => void |} {
|
||||||
|
console.error(
|
||||||
|
'BackHandler is not supported on web and should not be used.'
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
remove: emptyFunction
|
||||||
|
};
|
||||||
|
},
|
||||||
|
removeEventListener: emptyFunction
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BackHandler;
|
||||||
+1
@@ -13,6 +13,7 @@ export { default as Animated } from './exports/Animated';
|
|||||||
export { default as Appearance } from './exports/Appearance';
|
export { default as Appearance } from './exports/Appearance';
|
||||||
export { default as AppRegistry } from './exports/AppRegistry';
|
export { default as AppRegistry } from './exports/AppRegistry';
|
||||||
export { default as AppState } from './exports/AppState';
|
export { default as AppState } from './exports/AppState';
|
||||||
|
export { default as BackHandler } from './exports/BackHandler';
|
||||||
export { default as Clipboard } from './exports/Clipboard';
|
export { default as Clipboard } from './exports/Clipboard';
|
||||||
export { default as Dimensions } from './exports/Dimensions';
|
export { default as Dimensions } from './exports/Dimensions';
|
||||||
export { default as Easing } from './exports/Easing';
|
export { default as Easing } from './exports/Easing';
|
||||||
|
|||||||
Reference in New Issue
Block a user