Update flow to 0.142

This commit is contained in:
Charlie Croom
2021-03-20 11:37:05 -04:00
committed by Nicolas Gallagher
parent 7293a613d5
commit 26a3e1e958
8 changed files with 24 additions and 23 deletions
+5 -4
View File
@@ -14,18 +14,18 @@ import createElement from '../createElement';
import useMergeRefs from '../../modules/useMergeRefs';
import usePlatformMethods from '../../modules/usePlatformMethods';
import PickerItem from './PickerItem';
import StyleSheet, { type StyleObj } from '../StyleSheet';
import StyleSheet from '../StyleSheet';
import { forwardRef, useRef } from 'react';
type PickerProps = {
...ViewProps,
children?: PickerItem | Array<typeof PickerItem>,
children?: typeof PickerItem | Array<typeof PickerItem>,
enabled?: boolean,
onValueChange?: (number | string, number) => void,
selectedValue?: number | string,
style?: StyleObj,
style?: any,
/* compat */
itemStyle?: StyleObj,
itemStyle?: any,
mode?: string,
prompt?: string
};
@@ -55,6 +55,7 @@ const Picker = forwardRef<PickerProps, *>((props, forwardedRef) => {
}
}
// $FlowFixMe ViewProps should be exact in the future
const supportedProps: any = {
children,
disabled: enabled === false ? true : undefined,
@@ -99,7 +99,7 @@ export function classic(style: Style, name: string): CompilerOutput {
* Compile simple style object to inline DOM styles.
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
*/
export function inline(style: Style) {
export function inline(style: Style): any {
return prefixInlineStyles(createReactDOMStyle(style));
}
@@ -107,7 +107,7 @@ export function inline(style: Style) {
* Create a value string that normalizes different input values with a common
* output.
*/
export function stringifyValueWithProperty(value: Value, property: ?string) {
export function stringifyValueWithProperty(value: Value, property: ?string): string {
// e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'
const normalizedValue = normalizeValueWithProperty(value, property);
return typeof normalizedValue !== 'string'
@@ -152,17 +152,17 @@ function createAtomicRules(identifier: string, property, value): Rules {
if (value === 'auto' || value === 'box-only') {
finalValue = 'auto!important';
if (value === 'box-only') {
const block = createDeclarationBlock({ [property]: 'none' });
const block = createDeclarationBlock({ pointerEvents: 'none' });
rules.push(`${selector}>*${block}`);
}
} else if (value === 'none' || value === 'box-none') {
finalValue = 'none!important';
if (value === 'box-none') {
const block = createDeclarationBlock({ [property]: 'auto' });
const block = createDeclarationBlock({ pointerEvents: 'auto' });
rules.push(`${selector}>*${block}`);
}
}
const block = createDeclarationBlock({ [property]: finalValue });
const block = createDeclarationBlock({ pointerEvents: finalValue });
rules.push(`${selector}${block}`);
break;
}
@@ -173,7 +173,7 @@ function createAtomicRules(identifier: string, property, value): Rules {
if (value === 'none') {
rules.push(`${selector}::-webkit-scrollbar{display:none}`);
}
const block = createDeclarationBlock({ [property]: value });
const block = createDeclarationBlock({ scrollbarWidth: value });
rules.push(`${selector}${block}`);
break;
}
@@ -218,7 +218,7 @@ function createDeclarationBlock(style: Style) {
/**
* An identifier is associated with a unique set of styles.
*/
function createIdentifier(prefix, name, value) {
function createIdentifier(prefix: string, name: string, value): string {
const hashedString = hash(name + stringifyValueWithProperty(value, name));
return process.env.NODE_ENV !== 'production'
? `${prefix}-${name}-${hashedString}`
@@ -72,7 +72,7 @@ export default function createOrderedCSSStyleSheet(sheet: ?CSSStyleSheet) {
// Increment the starting index of all subsequent groups
for (let i = nextGroupIndex; i < orderedGroups.length; i += 1) {
const groupNumber = orderedGroups[i];
const previousStart = groups[groupNumber].start;
const previousStart = groups[groupNumber].start || 0;
groups[groupNumber].start = previousStart + 1;
}
}
+1 -3
View File
@@ -9,9 +9,7 @@
import * as React from 'react';
opaque type UninitializedMarker = Symbol | {||};
const UNINITIALIZED: UninitializedMarker =
const UNINITIALIZED =
typeof Symbol === 'function' && typeof Symbol() === 'symbol' ? Symbol() : Object.freeze({});
export default function useStable<T>(getInitialValue: () => T): T {