Skip to content

Commit

Permalink
fix: remove useCallback, and remove dir prop from textInput
Browse files Browse the repository at this point in the history
  • Loading branch information
al1rezaaa committed Dec 11, 2021
1 parent a16e8fe commit 3535d22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/component/src/molecules/text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ const Text = React.memo(
const fontWeight =
typeof weight === "number" ? weight : fontWeights[weight];

const setVariant = React.useCallback((): Variant => {
const setVariant = (): Variant => {
if (typeof size !== "number" && size?.match(/h(1|2|3|4|5|6)/g)) {
return size as Variant;
}
return "p";
}, [size]);
};

return (
<BaseText
Expand Down
1 change: 0 additions & 1 deletion src/component/src/muscles/textInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ const TextInput = React.forwardRef<HTMLElement, TextInputProps>(
className,
);
// 'auto' by default allows browsers to infer writing direction
supportedProps.dir = dir !== undefined ? dir : "auto";
(supportedProps as any).enterKeyHint = returnKeyType;
supportedProps.onBlur = handleBlur;
supportedProps.onChange = handleChange;
Expand Down

0 comments on commit 3535d22

Please sign in to comment.