mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-24 07:09:03 +00:00
committed by
Nicolas Gallagher
parent
c67b695b6b
commit
84fd278af1
@@ -3,7 +3,7 @@
|
||||
"react": {
|
||||
"pragma": "React",
|
||||
"version": "16.6",
|
||||
"flowVersion": "0.142.0" // Flow version
|
||||
"flowVersion": "0.148.0" // Flow version
|
||||
}
|
||||
},
|
||||
// babel parser to support ES6/7 features
|
||||
|
||||
+1
-8
@@ -1,5 +1,5 @@
|
||||
[version]
|
||||
^0.142.0
|
||||
^0.148.0
|
||||
|
||||
[ignore]
|
||||
<PROJECT_ROOT>/.*/__tests__/.*
|
||||
@@ -15,10 +15,3 @@
|
||||
|
||||
[options]
|
||||
munge_underscores=true
|
||||
types_first=false
|
||||
well_formed_exports=false
|
||||
esproposal.optional_chaining=enable
|
||||
suppress_type=$FlowIssue
|
||||
suppress_type=$FlowFixMe
|
||||
suppress_type=$FlowFixMeProps
|
||||
suppress_type=$FlowFixMeState
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.22.0",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"flow-bin": "^0.142.0",
|
||||
"flow-bin": "^0.148.0",
|
||||
"glob": "^7.1.6",
|
||||
"husky": "^4.3.8",
|
||||
"inline-style-prefixer": "^6.0.0",
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
/* global $Values */
|
||||
|
||||
import type { Node } from 'react';
|
||||
|
||||
import * as Timing from './timing';
|
||||
import React, { Component } from 'react';
|
||||
import { getMean, getMedian, getStdDev } from './math';
|
||||
@@ -94,15 +96,19 @@ export default class Benchmark extends Component<BenchmarkPropsType, BenchmarkSt
|
||||
_startTime: number;
|
||||
_samples: Array<SampleTimingType>;
|
||||
|
||||
static displayName = 'Benchmark';
|
||||
static displayName: ?string = 'Benchmark';
|
||||
|
||||
static defaultProps = {
|
||||
static defaultProps: {|
|
||||
sampleCount: number,
|
||||
timeout: number,
|
||||
type: $PropertyType<BenchmarkPropsType, 'type'>
|
||||
|} = {
|
||||
sampleCount: 50,
|
||||
timeout: 10000, // 10 seconds
|
||||
type: BenchmarkType.MOUNT
|
||||
};
|
||||
|
||||
static Type = BenchmarkType;
|
||||
static Type: typeof BenchmarkType = BenchmarkType;
|
||||
|
||||
constructor(props: BenchmarkPropsType, context?: {}) {
|
||||
super(props, context);
|
||||
@@ -162,7 +168,7 @@ export default class Benchmark extends Component<BenchmarkPropsType, BenchmarkSt
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
render(): Node {
|
||||
const { component: Component, type } = this.props;
|
||||
const { componentProps, cycle, running } = this.state;
|
||||
if (running && shouldRecord(cycle, type)) {
|
||||
|
||||
@@ -25,7 +25,7 @@ BoundingDimensions.prototype.destructor = function () {
|
||||
this.height = null;
|
||||
};
|
||||
|
||||
BoundingDimensions.getPooledFromElement = function (element): any {
|
||||
BoundingDimensions.getPooledFromElement = function (element: HTMLElement): any {
|
||||
return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight);
|
||||
};
|
||||
|
||||
|
||||
@@ -19,8 +19,9 @@ export default function useWindowDimensions(): DisplayMetrics {
|
||||
const [dims, setDims] = useState(() => Dimensions.get('window'));
|
||||
useEffect(() => {
|
||||
function handleChange({ window }) {
|
||||
// $FlowFixMe
|
||||
setDims(window);
|
||||
if (window != null) {
|
||||
setDims(window);
|
||||
}
|
||||
}
|
||||
Dimensions.addEventListener('change', handleChange);
|
||||
// We might have missed an update between calling `get` in render and
|
||||
|
||||
@@ -60,5 +60,6 @@ export default function useEvent(
|
||||
};
|
||||
}, [addListener]);
|
||||
|
||||
// $FlowFixMe
|
||||
return addListener;
|
||||
}
|
||||
|
||||
@@ -5321,10 +5321,10 @@ flatted@^3.1.0:
|
||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469"
|
||||
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==
|
||||
|
||||
flow-bin@^0.142.0:
|
||||
version "0.142.0"
|
||||
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.142.0.tgz#b46b69de1123cf7c5a50917402968e07291df054"
|
||||
integrity sha512-YgiapK/wrJjcgSgOWfoncbZ4vZrZWdHs+p7V9duI9zo4ehW2nM/VRrpSaWoZ+CWu3t+duGyAvupJvC6MM2l07w==
|
||||
flow-bin@^0.148.0:
|
||||
version "0.148.0"
|
||||
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.148.0.tgz#1d264606dbb4d6e6070cc98a775e21dcd64e6890"
|
||||
integrity sha512-7Cx6BUm8UAlbqtYJNYXdMrh900MQhNV+SjtBxZuWN7UmlVG4tIRNzNLEOjNnj2DN2vcL1wfI5IlSUXnws/QCEw==
|
||||
|
||||
follow-redirects@^1.0.0, follow-redirects@^1.10.0:
|
||||
version "1.13.1"
|
||||
|
||||
Reference in New Issue
Block a user