-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Flow types for React Native host components
Reviewed By: calebmer Differential Revision: D5844473 fbshipit-source-id: 2893e5a5ee58d147a2f7d351143a7ce0eb8eebe3
- Loading branch information
1 parent
2cb87df
commit 11b4084
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule View | ||
* @flow | ||
* @format | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const {NativeComponent} = require('ReactNative'); | ||
|
||
import type {ViewProps} from 'ViewPropTypes'; | ||
|
||
export type Props = ViewProps; | ||
|
||
/** | ||
* Host components in React 16 are represented by strings (eg "div", "View"). | ||
* This is inconvenient for users who want to type a ref (eg `ref: View`). | ||
* The following type isn't sound but it enables consistent Flow types | ||
* for various default React Native components, so it seems a good tradeoff. | ||
*/ | ||
declare class View extends NativeComponent<void, ViewProps> {} | ||
|
||
module.exports = View; |