Skip to content

Commit

Permalink
ProgressBarAndroid (facebook#23068)
Browse files Browse the repository at this point in the history
Summary:
his PR is related to facebook#22990

Changelog:
----------

[Android][Changed] - move the call to requireNativeComponent from ProgressBarAndroid.android.js to ProgressBarAndroidNativeComponent.js
Pull Request resolved: facebook#23068

Differential Revision: D13760445

Pulled By: cpojer

fbshipit-source-id: b74ff42c6f207803de70be549a13487d59125a66
  • Loading branch information
rafaellincoln authored and facebook-github-bot committed Jan 22, 2019
1 parent 499da14 commit 148dc31
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@

const React = require('React');

const requireNativeComponent = require('requireNativeComponent');
const ProgressBarAndroidNativeComponent = require('ProgressBarAndroidNativeComponent');

import type {NativeComponent} from 'ReactNative';
import type {ViewProps} from 'ViewPropTypes';

const AndroidProgressBar = requireNativeComponent('AndroidProgressBar');

export type ProgressBarAndroidProps = $ReadOnly<{|
...ViewProps,

Expand Down Expand Up @@ -84,9 +81,9 @@ export type ProgressBarAndroidProps = $ReadOnly<{|
*/
const ProgressBarAndroid = (
props: ProgressBarAndroidProps,
forwardedRef: ?React.Ref<'AndroidProgressBar'>,
forwardedRef: ?React.Ref<typeof ProgressBarAndroidNativeComponent>,
) => {
return <AndroidProgressBar {...props} ref={forwardedRef} />;
return <ProgressBarAndroidNativeComponent {...props} ref={forwardedRef} />;
};

const ProgressBarAndroidToExport = React.forwardRef(ProgressBarAndroid);
Expand All @@ -103,6 +100,4 @@ ProgressBarAndroidToExport.defaultProps = {
/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an
* error found when Flow v0.89 was deployed. To see the error, delete this
* comment and run Flow. */
module.exports = (ProgressBarAndroidToExport: Class<
NativeComponent<ProgressBarAndroidProps>,
>);
module.exports = (ProgressBarAndroidToExport: ProgressBarAndroidNativeComponent);
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/

'use strict';

const requireNativeComponent = require('requireNativeComponent');

import type {ViewProps} from 'ViewPropTypes';
import type {NativeComponent} from 'ReactNative';

type NativeProps = $ReadOnly<{|
...ViewProps,
styleAttr?: string,
typeAttr?: string,
indeterminate: boolean,
progress?: number,
animating?: ?boolean,
color?: ?string,
testID?: ?string,
|}>;

type ProgressBarAndroidType = Class<NativeComponent<NativeProps>>;

module.exports = ((requireNativeComponent(
'AndroidProgressBar',
): any): ProgressBarAndroidType);

0 comments on commit 148dc31

Please sign in to comment.