Skip to content

Commit

Permalink
Fix ref and component return types
Browse files Browse the repository at this point in the history
Summary:
These types aren't robust to changes in the React component type. When we refactor requireNativeComponent these will error. This change is forwards compatible.

Changelog:
[Internal] Improve internal type in DrawerLayoutAndroid

Reviewed By: JoshuaGross

Differential Revision: D17561194

fbshipit-source-id: 470289449b4d5b3148692f1945fb720e1e3972eb
  • Loading branch information
elicwhite authored and facebook-github-bot committed Sep 25, 2019
1 parent 419722b commit e028ac7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
drawerBackgroundColor: 'white',
};

_nativeRef = React.createRef<AndroidDrawerLayoutNativeComponent>();
_nativeRef = React.createRef<
React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>,
>();

state: State = {statusBarBackgroundColor: null};

Expand Down

0 comments on commit e028ac7

Please sign in to comment.