Skip to content

Commit 19509a0

Browse files
committed
0.7.0
1 parent 373394f commit 19509a0

File tree

6 files changed

+34
-15
lines changed

6 files changed

+34
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog of `@reason-react-native/safe-area-context`
22

3+
## 0.7.0 - 2020-02-29
4+
5+
6+
- Add `initialSafeAreaInsets` for SafeAreaProvider
7+
- Add `initialWindowSafeAreaInsets`
8+
39
## 0.6.0 - 2019-12-19
410

511
Initial release

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ type insets = {
5858
};
5959
```
6060

61+
### Constants
62+
63+
#### `initialWindowSafeAreaInsets`
64+
65+
See <https://github.com/th3rdwave/react-native-safe-area-context#optimization>
66+
6167
### Methods
6268

6369
#### `<ReactNativeSafeAreaContext.SafeAreaProvider>`
@@ -68,13 +74,16 @@ open ReactNativeSafeAreaContext;
6874
6975
[@react.component]
7076
let make = () => {
71-
<SafeAreaProvider>
77+
<SafeAreaProvider /*initialSafeAreaInsets={...}*/>
7278
// your app...
7379
<View />
7480
<SafeAreaProvider>;
7581
}
7682
```
7783

84+
See <https://github.com/th3rdwave/react-native-safe-area-context#web-ssr> for
85+
`initialSafeAreaInsets`.
86+
7887
#### `ReactNativeSafeAreaContext.useSafeArea(): insets`
7988

8089
```reason

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@reason-react-native/safe-area-context",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"publishConfig": {
55
"access": "public"
66
},
77
"peerDependencies": {
88
"reason-react": "^0.7.0",
99
"reason-react-native": "^0.61.0",
10-
"react-native-safe-area-context": "^0.6.0"
10+
"react-native-safe-area-context": "^0.7.0"
1111
},
1212
"repository": "https://github.com/reason-react-native/safe-area-context.git",
1313
"license": "MIT",
@@ -38,7 +38,7 @@
3838
"release": "npmpub"
3939
},
4040
"devDependencies": {
41-
"bs-platform": "^5.2.0",
41+
"bs-platform": "^7.2.0",
4242
"husky": "^1.3.0",
4343
"lint-staged": "^8.1.0",
4444
"npmpub": "^5.0.0",

src/ReactNativeSafeAreaContext.re

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
module SafeAreaProvider = {
2-
[@react.component] [@bs.module "react-native-safe-area-context"]
3-
external make: (~children: React.element=?) => React.element =
4-
"SafeAreaProvider";
5-
};
6-
71
type insets = {
82
.
93
"top": float,
@@ -12,6 +6,17 @@ type insets = {
126
"right": float,
137
};
148

9+
[@bs.module "react-native-safe-area-context"]
10+
external initialWindowSafeAreaInsets: insets = "initialWindowSafeAreaInsets";
11+
12+
module SafeAreaProvider = {
13+
[@react.component] [@bs.module "react-native-safe-area-context"]
14+
external make:
15+
(~initialSafeAreaInsets: insets, ~children: React.element=?) =>
16+
React.element =
17+
"SafeAreaProvider";
18+
};
19+
1520
[@bs.module "react-native-safe-area-context"]
1621
external useSafeArea: unit => insets = "useSafeArea";
1722

src/ReactNativeSomething.bs.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ braces@^2.3.1:
173173
split-string "^3.0.2"
174174
to-regex "^3.0.1"
175175

176-
bs-platform@^5.2.0:
177-
version "5.2.0"
178-
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-5.2.0.tgz#0ec317273daed573491c105f68ea48826a285b7a"
179-
integrity sha512-miyePsOF9VbuhT5QD5E/hb+l454Fo4MAcg5xV1GJhbWxmejuF/X7mCYUsNrK1UUAaYt8hnoyFdeLG22sxVta9A==
176+
bs-platform@^7.2.0:
177+
version "7.2.0"
178+
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-7.2.0.tgz#9b22a429313574de99e5a48e88224ae84ed64ee8"
179+
integrity sha512-mgwsJ3C1nthhasoR1L3H/7+v7zuCybxI8rTrxl4aOJZfrEZSU2a3E7QTEFfB4gHpOJUvmC1/LkwQNlTTrHautg==
180180

181181
cache-base@^1.0.1:
182182
version "1.0.1"

0 commit comments

Comments
 (0)