refactor(classnames): use faster classcat alternative

This commit is contained in:
moklick
2020-07-14 10:11:26 +02:00
parent dec1f973cb
commit 1b3f58486a
11 changed files with 43 additions and 25 deletions
@@ -1,5 +1,5 @@
import React, { memo, HTMLAttributes } from 'react';
import classnames from 'classnames';
import cc from 'classcat';
import { useStoreState } from '../../store/hooks';
import { BackgroundVariant } from '../../types';
@@ -25,7 +25,7 @@ const Background = memo(
const height = useStoreState((s) => s.height);
const [x, y, scale] = useStoreState((s) => s.transform);
const bgClasses = classnames('react-flow__background', className);
const bgClasses = cc(['react-flow__background', className]);
const bgColor = color ? color : defaultColors[variant];
const scaledGap = gap * scale;
const xOffset = x % scaledGap;