diff --git a/ci/e2e/App.js b/ci/e2e/App.js index 008101da2b..b89141e6c7 100644 --- a/ci/e2e/App.js +++ b/ci/e2e/App.js @@ -21,19 +21,19 @@ class MainScreen extends React.Component { title: '✌️ Gesture Handler Demo', }; render() { - const data = Object.keys(SCREENS).map(key => ({ key })); + const data = Object.keys(SCREENS).map((key) => ({ key })); return ( ( + renderItem={(props) => ( this.props.navigation.navigate(key)} /> )} - renderScrollComponent={props => } + renderScrollComponent={(props) => } /> ); } diff --git a/ci/e2e/babel.config.js b/ci/e2e/babel.config.js index 8d213922b6..c60ba19394 100644 --- a/ci/e2e/babel.config.js +++ b/ci/e2e/babel.config.js @@ -1,4 +1,4 @@ -module.exports = api => { +module.exports = (api) => { const isWeb = api.caller(isTargetWeb); return { diff --git a/ci/e2e/common.js b/ci/e2e/common.js index e053bd7566..1fffa0d833 100644 --- a/ci/e2e/common.js +++ b/ci/e2e/common.js @@ -13,9 +13,7 @@ export class LoremIpsum extends React.Component { style: styles.lipsum, }; loremIpsum() { - return LOREM_IPSUM.split(' ') - .slice(0, this.props.words) - .join(' '); + return LOREM_IPSUM.split(' ').slice(0, this.props.words).join(' '); } render() { return {this.loremIpsum()}; diff --git a/ci/e2e/e2e/init.js b/ci/e2e/e2e/init.js index 8d9960d759..b7b58350e8 100644 --- a/ci/e2e/e2e/init.js +++ b/ci/e2e/e2e/init.js @@ -6,11 +6,11 @@ before(async () => { await detox.init(config); }); -beforeEach(async function() { +beforeEach(async function () { await adapter.beforeEach(this); }); -afterEach(async function() { +afterEach(async function () { await adapter.afterEach(this); }); diff --git a/ci/e2e/multitap/index.js b/ci/e2e/multitap/index.js index 1a2c1339ed..fe3b359ebd 100644 --- a/ci/e2e/multitap/index.js +++ b/ci/e2e/multitap/index.js @@ -15,7 +15,7 @@ export class PressBox extends Component { lastGH: false, }; doubleTapRef = React.createRef(); - _onHandlerStateChange = event => { + _onHandlerStateChange = (event) => { if (event.nativeEvent.state === State.ACTIVE) { Alert.alert("I'm being pressed for so long"); this.setState({ @@ -23,7 +23,7 @@ export class PressBox extends Component { }); } }; - _onSingleTap = event => { + _onSingleTap = (event) => { if (event.nativeEvent.state === State.ACTIVE) { Alert.alert("I'm touched"); this.setState({ @@ -31,7 +31,7 @@ export class PressBox extends Component { }); } }; - _onDoubleTap = event => { + _onDoubleTap = (event) => { if (event.nativeEvent.state === State.ACTIVE) { Alert.alert('Double tap, good job!'); this.setState({ diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index eabfb5f6d8..0c0ac8be71 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -5,7 +5,7 @@ console.log(versions); const allDocHomesPaths = [ '/docs/next/', '/docs/', - ...versions.slice(1).map(version => `/docs/${version}/`), + ...versions.slice(1).map((version) => `/docs/${version}/`), ]; const baseUrl = process.env.BASE_URL || '/'; 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" "*" diff --git a/package.json b/package.json index 0e903ffc67..195ed5c0e6 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/src/PlatformConstants.ts b/src/PlatformConstants.ts index 955053c9bc..cf7ad645b4 100644 --- a/src/PlatformConstants.ts +++ b/src/PlatformConstants.ts @@ -1,7 +1,8 @@ -import { NativeModules } from 'react-native'; +import { NativeModules, Platform } from 'react-native'; type PlatformConstants = { forceTouchAvailable: boolean; }; -export default NativeModules.PlatformConstants as PlatformConstants; +export default (NativeModules?.PlatformConstants ?? + Platform.constants) as PlatformConstants; 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"