mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Lock down constrain writes in some directories
Summary: Changelog: [internal] Reviewed By: gkz Differential Revision: D36214426 fbshipit-source-id: 8498ef0f646d8a38e5d523f4fd2deacf1b649fd2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6b6adcc111
commit
23a160ebf6
@@ -207,7 +207,7 @@ class AsyncStorageTest extends React.Component<{...}, $FlowFixMeState> {
|
||||
this.setState({done: true}, () => {
|
||||
TestModule.markTestCompleted();
|
||||
});
|
||||
updateMessage = msg => {
|
||||
updateMessage = (msg: string) => {
|
||||
this.setState({messages: this.state.messages.concat('\n' + msg)});
|
||||
DEBUG && console.log(msg);
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ export type ImageComponentStatics = $ReadOnly<{|
|
||||
*
|
||||
* See https://reactnative.dev/docs/image
|
||||
*/
|
||||
let Image = (props: ImagePropsType, forwardedRef) => {
|
||||
const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
let source = resolveAssetSource(props.source);
|
||||
const defaultSource = resolveAssetSource(props.defaultSource);
|
||||
const loadingIndicatorSource = resolveAssetSource(
|
||||
@@ -221,11 +221,11 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
||||
);
|
||||
};
|
||||
|
||||
Image = React.forwardRef<
|
||||
let Image = React.forwardRef<
|
||||
ImagePropsType,
|
||||
| React.ElementRef<typeof TextInlineImageNativeComponent>
|
||||
| React.ElementRef<typeof ImageViewNativeComponent>,
|
||||
>(Image);
|
||||
>(BaseImage);
|
||||
|
||||
if (ImageInjection.unstable_createImageComponent != null) {
|
||||
Image = ImageInjection.unstable_createImageComponent(Image);
|
||||
|
||||
@@ -102,7 +102,7 @@ export type ImageComponentStatics = $ReadOnly<{|
|
||||
*
|
||||
* See https://reactnative.dev/docs/image
|
||||
*/
|
||||
let Image = (props: ImagePropsType, forwardedRef) => {
|
||||
const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
const source = resolveAssetSource(props.source) || {
|
||||
uri: undefined,
|
||||
width: undefined,
|
||||
@@ -158,11 +158,12 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
||||
);
|
||||
};
|
||||
|
||||
Image = React.forwardRef<
|
||||
const ImageForwardRef = React.forwardRef<
|
||||
ImagePropsType,
|
||||
React.ElementRef<typeof ImageViewNativeComponent>,
|
||||
>(Image);
|
||||
>(BaseImage);
|
||||
|
||||
let Image = ImageForwardRef;
|
||||
if (ImageInjection.unstable_createImageComponent != null) {
|
||||
Image = ImageInjection.unstable_createImageComponent(Image);
|
||||
}
|
||||
|
||||
@@ -1875,15 +1875,15 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
'Tried to get frame for out of range index ' + index,
|
||||
);
|
||||
const item = getItem(data, index);
|
||||
let frame = item && this._frames[this._keyExtractor(item, index)];
|
||||
const frame = item && this._frames[this._keyExtractor(item, index)];
|
||||
if (!frame || frame.index !== index) {
|
||||
if (getItemLayout) {
|
||||
frame = getItemLayout(data, index);
|
||||
/* $FlowFixMe[prop-missing] (>=0.63.0 site=react_native_fb) This comment
|
||||
* suppresses an error found when Flow v0.63 was deployed. To see the error
|
||||
* delete this comment and run Flow. */
|
||||
return getItemLayout(data, index);
|
||||
}
|
||||
}
|
||||
/* $FlowFixMe[prop-missing] (>=0.63.0 site=react_native_fb) This comment
|
||||
* suppresses an error found when Flow v0.63 was deployed. To see the error
|
||||
* delete this comment and run Flow. */
|
||||
return frame;
|
||||
};
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ export function parseLogBoxLog(args: $ReadOnlyArray<mixed>): {|
|
||||
|} {
|
||||
const message = args[0];
|
||||
let argsWithoutComponentStack = [];
|
||||
let componentStack = [];
|
||||
let componentStack: ComponentStack = [];
|
||||
|
||||
// Extract component stack from warnings like "Some warning%s".
|
||||
if (
|
||||
|
||||
@@ -39,7 +39,7 @@ if (__DEV__) {
|
||||
let originalConsoleError;
|
||||
let originalConsoleWarn;
|
||||
let consoleErrorImpl;
|
||||
let consoleWarnImpl;
|
||||
let consoleWarnImpl: (...args: Array<mixed>) => void;
|
||||
|
||||
let isLogBoxInstalled: boolean = false;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ const ReactTestRenderer = require('react-test-renderer');
|
||||
const setAndForwardRef = require('../setAndForwardRef');
|
||||
|
||||
describe('setAndForwardRef', () => {
|
||||
let innerFuncCalled = false;
|
||||
let outerFuncCalled = false;
|
||||
let innerFuncCalled: ?boolean = false;
|
||||
let outerFuncCalled: ?boolean = false;
|
||||
|
||||
class ForwardedComponent extends React.Component<{||}> {
|
||||
testFunc() {
|
||||
|
||||
@@ -47,15 +47,10 @@ const styles = StyleSheet.create({
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
});
|
||||
/* $FlowFixMe[cannot-reassign-export] (>=0.85.0 site=react_native_fb) This
|
||||
* comment suppresses an error found when Flow v0.85 was deployed. To see the
|
||||
* error, delete this comment and run Flow. */
|
||||
// $FlowFixMe[cannot-reassign]
|
||||
RNTesterSettingSwitchRow = RNTesterStatePersister.createContainer(
|
||||
RNTesterSettingSwitchRow,
|
||||
{
|
||||
|
||||
const RNTesterSettingSwitchRowContainer: React.ComponentType<$FlowFixMeProps> =
|
||||
RNTesterStatePersister.createContainer(RNTesterSettingSwitchRow, {
|
||||
cacheKeySuffix: ({label}) => 'Switch:' + label,
|
||||
getInitialState: ({initialValue}) => initialValue,
|
||||
},
|
||||
);
|
||||
module.exports = RNTesterSettingSwitchRow;
|
||||
});
|
||||
module.exports = RNTesterSettingSwitchRowContainer;
|
||||
|
||||
Reference in New Issue
Block a user