Skip to content

Commit

Permalink
Remove editor state null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
smoores-dev committed Sep 17, 2024
1 parent 0c93e2e commit e194d3e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React-ProseMirror Demo</title>
<script type="module" crossorigin src="/react-prosemirror/assets/index-AEIvD9jW.js"></script>
<script type="module" crossorigin src="/react-prosemirror/assets/index-C72Cerdq.js"></script>
<link rel="stylesheet" crossorigin href="/react-prosemirror/assets/index-DAGU9WLy.css">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChildNodeViews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function InlineView({ innerPos, childViews }: SharedMarksProps) {

return cloneElement(childElement, {
key: createKey(
editorState?.doc,
editorState.doc,
innerPos,
child,
reactKeys?.posToKey
Expand Down Expand Up @@ -390,7 +390,7 @@ export function ChildNodeViews({
const childElements = createChildElements(
children,
innerPos,
editorState?.doc,
editorState.doc,
reactKeys?.posToKey
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/NodeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function NodeView({
decorations: outerDeco,
innerDecorations: innerDeco,
isSelected:
state?.selection instanceof NodeSelection &&
state.selection instanceof NodeSelection &&
state.selection.node === node,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useReactKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { useEditorState } from "./useEditorState.js";

export function useReactKeys() {
const state = useEditorState();
return state && reactKeysPluginKey.getState(state);
return reactKeysPluginKey.getState(state);
}

0 comments on commit e194d3e

Please sign in to comment.