react-native-safe-area-context
Advanced tools
Comparing version 4.6.3 to 4.7.4
@@ -54,13 +54,21 @@ "use strict"; | ||
} = event; | ||
if ( | ||
// Backwards compat with old native code that won't send frame. | ||
nextFrame && (nextFrame.height !== frame.height || nextFrame.width !== frame.width || nextFrame.x !== frame.x || nextFrame.y !== frame.y)) { | ||
setFrame(nextFrame); | ||
} | ||
if (!insets || nextInsets.bottom !== insets.bottom || nextInsets.left !== insets.left || nextInsets.right !== insets.right || nextInsets.top !== insets.top) { | ||
setInsets(nextInsets); | ||
} | ||
}, [frame, insets]); | ||
setFrame(frame => { | ||
if ( | ||
// Backwards compat with old native code that won't send frame. | ||
nextFrame && (nextFrame.height !== frame.height || nextFrame.width !== frame.width || nextFrame.x !== frame.x || nextFrame.y !== frame.y)) { | ||
return nextFrame; | ||
} else { | ||
return frame; | ||
} | ||
}); | ||
setInsets(insets => { | ||
if (!insets || nextInsets.bottom !== insets.bottom || nextInsets.left !== insets.left || nextInsets.right !== insets.right || nextInsets.top !== insets.top) { | ||
return nextInsets; | ||
} else { | ||
return insets; | ||
} | ||
}); | ||
}, []); | ||
return /*#__PURE__*/React.createElement(_NativeSafeAreaProvider.NativeSafeAreaProvider, _extends({ | ||
style: [styles.fill, style], | ||
style: _reactNative.StyleSheet.compose(styles.fill, style), | ||
onInsetsChange: onInsetsChange | ||
@@ -67,0 +75,0 @@ }, others), insets != null ? /*#__PURE__*/React.createElement(SafeAreaFrameContext.Provider, { |
@@ -39,13 +39,21 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
} = event; | ||
if ( | ||
// Backwards compat with old native code that won't send frame. | ||
nextFrame && (nextFrame.height !== frame.height || nextFrame.width !== frame.width || nextFrame.x !== frame.x || nextFrame.y !== frame.y)) { | ||
setFrame(nextFrame); | ||
} | ||
if (!insets || nextInsets.bottom !== insets.bottom || nextInsets.left !== insets.left || nextInsets.right !== insets.right || nextInsets.top !== insets.top) { | ||
setInsets(nextInsets); | ||
} | ||
}, [frame, insets]); | ||
setFrame(frame => { | ||
if ( | ||
// Backwards compat with old native code that won't send frame. | ||
nextFrame && (nextFrame.height !== frame.height || nextFrame.width !== frame.width || nextFrame.x !== frame.x || nextFrame.y !== frame.y)) { | ||
return nextFrame; | ||
} else { | ||
return frame; | ||
} | ||
}); | ||
setInsets(insets => { | ||
if (!insets || nextInsets.bottom !== insets.bottom || nextInsets.left !== insets.left || nextInsets.right !== insets.right || nextInsets.top !== insets.top) { | ||
return nextInsets; | ||
} else { | ||
return insets; | ||
} | ||
}); | ||
}, []); | ||
return /*#__PURE__*/React.createElement(NativeSafeAreaProvider, _extends({ | ||
style: [styles.fill, style], | ||
style: StyleSheet.compose(styles.fill, style), | ||
onInsetsChange: onInsetsChange | ||
@@ -52,0 +60,0 @@ }, others), insets != null ? /*#__PURE__*/React.createElement(SafeAreaFrameContext.Provider, { |
import * as React from 'react'; | ||
import { ViewProps } from 'react-native'; | ||
import { type ViewProps } from 'react-native'; | ||
import type { EdgeInsets, Metrics, Rect } from './SafeArea.types'; | ||
@@ -4,0 +4,0 @@ export declare const SafeAreaInsetsContext: React.Context<EdgeInsets | null>; |
{ | ||
"name": "react-native-safe-area-context", | ||
"version": "4.6.3", | ||
"version": "4.7.4", | ||
"description": "A flexible way to handle safe area, also works on Android and web.", | ||
@@ -44,3 +44,2 @@ "main": "lib/commonjs/index.js", | ||
"release": "release-it", | ||
"prepublish": "yarn test", | ||
"prepare": "bob build" | ||
@@ -82,7 +81,7 @@ }, | ||
"jest": "^29.5.0", | ||
"metro-react-native-babel-preset": "^0.76.3", | ||
"metro-react-native-babel-preset": "0.76.5", | ||
"prettier": "^2.8.8", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-native": "0.71.7", | ||
"react-native": "0.72.1", | ||
"react-native-builder-bob": "^0.20.4", | ||
@@ -89,0 +88,0 @@ "react-test-renderer": "^18.2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
238997
1809
3
0
21