Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"constructors": "no-public",
"methods": "explicit",
"properties": "off",
"parameterProperties": "explicit",
},
"parameterProperties": "explicit"
}
}
],
"no-bitwise": [
Expand Down Expand Up @@ -76,6 +76,17 @@
"import/consistent-type-specifier-style": [
"error",
"prefer-top-level"
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "lodash",
"message": "Import from lodash leads to bundle pollute. Use import from submodules, for example 'lodash/isEqual'."
}
]
}
]
}
}
4 changes: 1 addition & 3 deletions src/react-components/Block.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";

import { noop } from "lodash";

import { TBlock } from "../components/canvas/blocks/Block";
import { Graph } from "../graph";
import { ESchedulerPriority } from "../lib/Scheduler";
Expand Down Expand Up @@ -90,7 +88,7 @@
ref: ForwardedRef<HTMLDivElement>
) {
const containerRef = useRef<HTMLDivElement>(null);
useImperativeHandle(ref, () => containerRef.current!);

Check warning on line 91 in src/react-components/Block.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Forbidden non-null assertion
const lastStateRef = useRef({ x: 0, y: 0, width: 0, height: 0, zIndex: 0 });
const state = useBlockState(graph, block);

Expand Down Expand Up @@ -168,9 +166,9 @@
* So to handle update this props we use onChange callback from view state.
*/
useEffect(() => {
if (!viewState) return noop;
if (!viewState) return;
setInteractive(viewState.isInteractive());
return viewState.onChange(() => {

Check warning on line 171 in src/react-components/Block.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Arrow function expected no return value
setInteractive(viewState.isInteractive());
});
}, [viewState]);
Expand Down
Loading