Skip to content

Commit 7d669d6

Browse files
committed
react [nfc]: Use import * as React in MessageList.js
The namespace import `import * as React` will allow us to use the same `React.Foo` style for types as for values, and avoid the hackier `React$Foo` naming.
1 parent 868ba9c commit 7d669d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/webview/MessageList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* @flow strict-local */
2-
import React, { Component, type ComponentType } from 'react';
2+
import * as React from 'react';
33
import { Platform, NativeModules } from 'react-native';
44
import { WebView } from 'react-native-webview';
55

@@ -102,7 +102,7 @@ const assetsUrl =
102102
*/
103103
const webviewAssetsUrl = new URL('webview/', assetsUrl);
104104

105-
class MessageListInner extends Component<Props> {
105+
class MessageListInner extends React.Component<Props> {
106106
webviewRef = React.createRef<React$ElementRef<typeof WebView>>();
107107
sendInboundEventsIsReady: boolean;
108108
unsentInboundEvents: WebViewInboundEvent[] = [];
@@ -283,7 +283,7 @@ const marksMessagesAsRead = (narrow: Narrow): boolean =>
283283
mentioned: () => false,
284284
});
285285

286-
const MessageList: ComponentType<OuterProps> = connect<SelectorProps, _, _>(
286+
const MessageList: React.ComponentType<OuterProps> = connect<SelectorProps, _, _>(
287287
(state, props: OuterProps) => {
288288
// If this were a function component with Hooks, these would be
289289
// useGlobalSelector calls and would coexist perfectly smoothly with

0 commit comments

Comments
 (0)