Skip to content

Commit e96ee55

Browse files
authored
[lexical-react] replace abstract component (#6752)
1 parent 409c65e commit e96ee55

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

.flowconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ untyped-type-import=error
1717
[options]
1818
server.max_workers=4
1919
exact_by_default=true
20+
component_syntax=true
2021

2122
;; [generated-start update-flowconfig]
2223
module.name_mapper='^lexical$' -> '<PROJECT_ROOT>/packages/lexical/flow/Lexical.js.flow'
@@ -105,4 +106,4 @@ nonstrict-import
105106
unclear-type
106107

107108
[version]
108-
^0.226.0
109+
^0.250.0

libdefs/yjs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ declare module 'yjs' {
644644
};
645645

646646
declare type StackItem = {
647+
// $FlowFixMe: perhaps add generic typing instead of mixed
647648
meta: Map<mixed, mixed>,
648649
type: 'undo' | 'redo',
649650
};

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"eslint-plugin-react-hooks": "^4.6.2",
161161
"eslint-plugin-simple-import-sort": "^12.1.0",
162162
"eslint-plugin-sort-keys-fix": "^1.1.2",
163-
"flow-bin": "^0.226.0",
163+
"flow-bin": "^0.250.0",
164164
"fs-extra": "^10.0.0",
165165
"glob": "^10.4.1",
166166
"google-closure-compiler": "^20220202.0.0",

packages/lexical-react/flow/LexicalContentEditable.js.flow

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ import type { LexicalEditor } from 'lexical';
1212
import type {TRefFor} from 'CoreTypes.flow';
1313

1414
import * as React from 'react';
15-
import type { AbstractComponent } from "react";
1615

1716
type InlineStyle = {
18-
[key: string]: mixed;
19-
}
17+
[key: string]: mixed,
18+
};
2019

2120
// Due to Flow limitations, we prefer fixed types over the built-in inexact HTMLElement
2221
type HTMLDivElementDOMProps = $ReadOnly<{
@@ -29,7 +28,7 @@ type HTMLDivElementDOMProps = $ReadOnly<{
2928
'aria-invalid'?: void | boolean,
3029
'aria-owns'?: void | string,
3130
'title'?: void | string,
32-
onClick?: void | (e: SyntheticEvent<HTMLDivElement>) => mixed,
31+
onClick?: void | ((e: SyntheticEvent<HTMLDivElement>) => mixed),
3332
autoCapitalize?: void | boolean,
3433
autoComplete?: void | boolean,
3534
autoCorrect?: void | boolean,
@@ -72,11 +71,10 @@ export type Props = $ReadOnly<{
7271
ariaOwns?: string,
7372
ariaRequired?: string,
7473
autoCapitalize?: boolean,
75-
ref?: TRefFor<HTMLDivElement>,
76-
...PlaceholderProps
77-
}>
74+
...PlaceholderProps,
75+
}>;
7876

79-
declare export var ContentEditable: AbstractComponent<
80-
Props,
81-
HTMLDivElement,
82-
>;
77+
declare export var ContentEditable: component(
78+
ref: React.RefSetter<HTMLDivElement>,
79+
...Props
80+
);

0 commit comments

Comments
 (0)