Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Standalone for NativeComponents] ProgressBarAndroid #23068

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);