@portal-hq/webview 4.1.3 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,9 +144,9 @@ const Webview = (0, react_1.memo)((0, react_1.forwardRef)(({ onNavigationStateCh
144
144
  }, []);
145
145
  // Handle Android stuff
146
146
  (0, react_1.useEffect)(() => {
147
- react_native_1.BackHandler.addEventListener('hardwareBackPress', handleBackPress);
147
+ const subscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', handleBackPress);
148
148
  return () => {
149
- react_native_1.BackHandler.removeEventListener('hardwareBackPress', handleBackPress);
149
+ subscription.remove();
150
150
  };
151
151
  }, []);
152
152
  // Ensure that the webView ref gets forwarded to the parent component
@@ -18,7 +18,6 @@ const styles = react_native_1.StyleSheet.create({
18
18
  backgroundColor: 'rgba(0, 0, 0, 0.1)',
19
19
  height: '100%',
20
20
  justifyContent: 'center',
21
- justifyItems: 'center',
22
21
  width: '100%',
23
22
  },
24
23
  });
package/lib/esm/index.js CHANGED
@@ -116,9 +116,9 @@ const Webview = memo(forwardRef(({ onNavigationStateChange, onSigningRequested,
116
116
  }, []);
117
117
  // Handle Android stuff
118
118
  useEffect(() => {
119
- BackHandler.addEventListener('hardwareBackPress', handleBackPress);
119
+ const subscription = BackHandler.addEventListener('hardwareBackPress', handleBackPress);
120
120
  return () => {
121
- BackHandler.removeEventListener('hardwareBackPress', handleBackPress);
121
+ subscription.remove();
122
122
  };
123
123
  }, []);
124
124
  // Ensure that the webView ref gets forwarded to the parent component
@@ -13,7 +13,6 @@ const styles = StyleSheet.create({
13
13
  backgroundColor: 'rgba(0, 0, 0, 0.1)',
14
14
  height: '100%',
15
15
  justifyContent: 'center',
16
- justifyItems: 'center',
17
16
  width: '100%',
18
17
  },
19
18
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/webview",
3
- "version": "4.1.3",
3
+ "version": "4.1.5",
4
4
  "license": "MIT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/esm/index",
@@ -18,9 +18,9 @@
18
18
  "test": "jest --passWithNoTests"
19
19
  },
20
20
  "dependencies": {
21
- "@portal-hq/core": "^4.1.3",
22
- "@portal-hq/injected-provider": "^4.1.3",
23
- "@portal-hq/utils": "^4.1.3"
21
+ "@portal-hq/core": "^4.1.5",
22
+ "@portal-hq/injected-provider": "^4.1.5",
23
+ "@portal-hq/utils": "^4.1.5"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/jest": "^29.2.0",
@@ -36,5 +36,5 @@
36
36
  "react-native": "*",
37
37
  "react-native-webview": "*"
38
38
  },
39
- "gitHead": "912b03f1152f4dbb7e017919c63bdc950ca867cf"
39
+ "gitHead": "5ba19390f12935fc74b6235a4b2655a1e1c7a07f"
40
40
  }
package/src/index.tsx CHANGED
@@ -164,13 +164,13 @@ const Webview = memo(
164
164
 
165
165
  // Handle Android stuff
166
166
  useEffect(() => {
167
- BackHandler.addEventListener('hardwareBackPress', handleBackPress)
167
+ const subscription = BackHandler.addEventListener(
168
+ 'hardwareBackPress',
169
+ handleBackPress,
170
+ )
168
171
 
169
172
  return () => {
170
- BackHandler.removeEventListener(
171
- 'hardwareBackPress',
172
- handleBackPress,
173
- )
173
+ subscription.remove()
174
174
  }
175
175
  }, [])
176
176
 
@@ -18,7 +18,6 @@ const styles = StyleSheet.create({
18
18
  backgroundColor: 'rgba(0, 0, 0, 0.1)',
19
19
  height: '100%',
20
20
  justifyContent: 'center',
21
- justifyItems: 'center',
22
21
  width: '100%',
23
22
  },
24
23
  })