chore: reduce code by gndelia/codemod-replace-react-fc-typescript

This commit is contained in:
DarkSky
2022-08-12 01:26:27 +08:00
parent b4f56cda59
commit 40b617c429
73 changed files with 108 additions and 115 deletions
@@ -16,7 +16,7 @@ type GridHandleProps = {
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
};
export const GridHandle: FC<GridHandleProps> = function ({
export const GridHandle = function ({
blockId,
editor,
enabledAddItem,
@@ -25,7 +25,7 @@ export const GridHandle: FC<GridHandleProps> = function ({
draggable,
alertHandleId,
onMouseEnter,
}) {
}: GridHandleProps) {
const [isMouseDown, setIsMouseDown] = useState<boolean>(false);
const handleMouseDown: React.MouseEventHandler<HTMLDivElement> = e => {
if (draggable) {
@@ -20,7 +20,7 @@ export function removePercent(str: string) {
return str.replace('%', '');
}
export const Grid: FC<CreateView> = function (props) {
export const Grid = function (props: CreateView) {
const { block, editor } = props;
const gridItemMinWidth = editor.configManager.grid.gridItemMinWidth;
const [isOnDrag, setIsOnDrag] = useState<boolean>(false);