Skip to content

Commit bb43454

Browse files
committed
🐛 #text-inputのReactの内部構造の変更に追随した
1 parent e889c66 commit bb43454

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

browser/dom/caret.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface CaretInfo {
2626
/** 選択範囲の位置 */ selectionRange: Range;
2727
}
2828

29-
interface ReactInternalInstance {
29+
interface ReactFiber {
3030
return: {
3131
return: {
3232
stateNode: {
@@ -48,15 +48,15 @@ export function caret(): CaretInfo {
4848
}
4949

5050
const reactKey = Object.keys(textarea)
51-
.find((key) => key.startsWith("__reactInternalInstance"));
51+
.find((key) => key.startsWith("__reactFiber"));
5252
if (!reactKey) {
5353
throw Error(
54-
"div.cursor must has the property whose name starts with `__reactInternalInstance`",
54+
'div.cursor must has the property whose name starts with "__reactFiber"',
5555
);
5656
}
5757

5858
// @ts-ignore DOMを無理矢理objectとして扱っている
5959
return (textarea[
6060
reactKey
61-
] as ReactInternalInstance).return.return.stateNode.props;
61+
] as ReactFiber).return.return.stateNode.props;
6262
}

0 commit comments

Comments
 (0)