Skip to content

Commit

Permalink
Merge pull request #148 from element-hq/react-warnings
Browse files Browse the repository at this point in the history
Fix some React warnings
  • Loading branch information
robintown authored Feb 12, 2024
2 parents 075650a + d153f50 commit 14a139d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
10 changes: 4 additions & 6 deletions src/components/Form/Controls/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ type TextProps = {
* A styled text input, for standalone use.
*/
export const TextInput = forwardRef<HTMLInputElement, TextProps>(
function TextInput(props, ref) {
const classes = classNames(
styles.control,
props.className,
props.enableLigatures && styles["enable-ligatures"],
);
function TextInput({ className, enableLigatures, ...props }, ref) {
const classes = classNames(styles.control, className, {
[styles["enable-ligatures"]]: enableLigatures,
});
return <input ref={ref} {...props} className={classes} />;
},
);
Expand Down
14 changes: 6 additions & 8 deletions src/components/Icon/IndicatorIcon/IndicatorIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,16 @@ type IconButtonProps = {
};

export const IndicatorIcon = forwardRef<
HTMLButtonElement,
HTMLDivElement,
PropsWithChildren<IconButtonProps>
>(function IconButton({
children,
className,
size = "100%",
colour,
indicator,
}) {
>(function IconButton(
{ children, className, size = "100%", colour, indicator },
ref,
) {
const classes = classnames(styles["indicator-icon"], className);
return (
<div
ref={ref}
className={classes}
data-indicator={indicator}
style={
Expand Down

0 comments on commit 14a139d

Please sign in to comment.