From b405983f198375cbd2c8601dcada85fd54efcffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drew=20Andr=C3=A9?= Date: Tue, 13 Oct 2020 12:01:13 -0400 Subject: [PATCH 1/4] correct platform constants import --- PlatformConstants.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlatformConstants.js b/PlatformConstants.js index bfdc61be82..0ed4f4f09e 100644 --- a/PlatformConstants.js +++ b/PlatformConstants.js @@ -1,3 +1,3 @@ -import { NativeModules } from 'react-native'; +import { Platform } from 'react-native'; -export default NativeModules.PlatformConstants; +export default Platform.constants; From 7ce6e6fc41f38e89688e2de144c0607392767c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drew=20Andr=C3=A9?= Date: Fri, 16 Oct 2020 11:59:01 -0400 Subject: [PATCH 2/4] Update PlatformConstants.js This looks great, I didn't think that PlatformConstants may be used in older versions of this library. Thanks for the suggestion! Co-authored-by: Jakub Adamczyk <16062886+jkadamczyk@users.noreply.github.com> --- PlatformConstants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlatformConstants.js b/PlatformConstants.js index 0ed4f4f09e..b8d9f531d7 100644 --- a/PlatformConstants.js +++ b/PlatformConstants.js @@ -1,3 +1,3 @@ import { Platform } from 'react-native'; -export default Platform.constants; +export default NativeModules?.PlatformConstants ?? Platform.constants; From a5c6a05d89fd8a5af3d4dbff27dec0e685c93fb4 Mon Sep 17 00:00:00 2001 From: Jakub Gonet Date: Sat, 13 Feb 2021 12:51:03 +0100 Subject: [PATCH 3/4] Upgrade @types/react-native --- package.json | 2 +- yarn.lock | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 3e793d1a4f..93076cc78d 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@types/hoist-non-react-statics": "^3.3.1", "@types/jest": "^26.0.19", "@types/react": "^17.0.0", - "@types/react-native": "^0.63.44", + "@types/react-native": "^0.63.49", "@types/react-test-renderer": "^17.0.0", "@typescript-eslint/eslint-plugin": "^4.10.0", "@typescript-eslint/parser": "^4.10.0", diff --git a/yarn.lock b/yarn.lock index 46942c83a3..585d101bad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2206,15 +2206,16 @@ "@types/prop-types@*": version "15.7.3" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== "@types/qs@^6.5.1": version "6.9.3" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.3.tgz#b755a0934564a200d3efdf88546ec93c369abd03" -"@types/react-native@^0.63.44": - version "0.63.44" - resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.44.tgz#cd8df1bb6b2764b47afc1e643d20fb503dbfc52d" - integrity sha512-zTb6/mTehBtTBouFEvYzLv4rY+p1ujFVB+biO6KRaXQ+8rDeRabtvYVLf8ScZUL3qnahn38vHbcE6P63FneqOg== +"@types/react-native@^0.63.49": + version "0.63.49" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.49.tgz#b9a4781a0543763f0079c3ef2ba2148a4509b32e" + integrity sha512-ivTn2n9xsmlwSO1GygkwEMjkrSDqPAJVhbhsl3EffGtG6zWPaJ+AJVImPoBZN1VY8GItGPPlLGEb0i6LGb83VA== dependencies: "@types/react" "*" @@ -2226,11 +2227,12 @@ "@types/react" "*" "@types/react@*": - version "16.9.43" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.43.tgz#c287f23f6189666ee3bebc2eb8d0f84bcb6cdb6b" + version "17.0.2" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.2.tgz#3de24c4efef902dd9795a49c75f760cbe4f7a5a8" + integrity sha512-Xt40xQsrkdvjn1EyWe1Bc0dJLcil/9x2vAuW7ya+PuQip4UYUaXyhzWmAbwRsdMgwOFHpfp7/FFZebDU6Y8VHA== dependencies: "@types/prop-types" "*" - csstype "^2.2.0" + csstype "^3.0.2" "@types/react@^17.0.0": version "17.0.0" @@ -3551,10 +3553,6 @@ cssstyle@^1.0.0: dependencies: cssom "0.3.x" -csstype@^2.2.0: - version "2.6.11" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.11.tgz#452f4d024149ecf260a852b025e36562a253ffc5" - csstype@^3.0.2: version "3.0.5" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.5.tgz#7fdec6a28a67ae18647c51668a9ff95bb2fa7bb8" From 66f08b6ef385292b73413c1c254686e1df5469f6 Mon Sep 17 00:00:00 2001 From: Jakub Gonet Date: Sat, 13 Feb 2021 13:14:42 +0100 Subject: [PATCH 4/4] Bump @types/react-native in examples --- examples/Example/package.json | 2 +- examples/Example/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/Example/package.json b/examples/Example/package.json index dcd886250e..229c50c935 100644 --- a/examples/Example/package.json +++ b/examples/Example/package.json @@ -32,7 +32,7 @@ "@babel/runtime": "^7.12.5", "@expo/webpack-config": "^0.12.52", "@types/jest": "^25.2.3", - "@types/react-native": "^0.63.44", + "@types/react-native": "^0.63.49", "@types/react-test-renderer": "^16.9.2", "@typescript-eslint/parser": "^4.9.1", "babel-jest": "^25.1.0", diff --git a/examples/Example/yarn.lock b/examples/Example/yarn.lock index 47c8609679..db6eabde04 100644 --- a/examples/Example/yarn.lock +++ b/examples/Example/yarn.lock @@ -2188,10 +2188,10 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== -"@types/react-native@^0.63.44": - version "0.63.44" - resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.44.tgz#cd8df1bb6b2764b47afc1e643d20fb503dbfc52d" - integrity sha512-zTb6/mTehBtTBouFEvYzLv4rY+p1ujFVB+biO6KRaXQ+8rDeRabtvYVLf8ScZUL3qnahn38vHbcE6P63FneqOg== +"@types/react-native@^0.63.49": + version "0.63.49" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.49.tgz#b9a4781a0543763f0079c3ef2ba2148a4509b32e" + integrity sha512-ivTn2n9xsmlwSO1GygkwEMjkrSDqPAJVhbhsl3EffGtG6zWPaJ+AJVImPoBZN1VY8GItGPPlLGEb0i6LGb83VA== dependencies: "@types/react" "*"