Skip to content

Commit

Permalink
fix ref
Browse files Browse the repository at this point in the history
  • Loading branch information
riktar committed Jul 26, 2021
1 parent 70378bf commit a6a2153
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
generateDisabled,
} from "../../Utils/Utils";

const Button = (btnProps, ref) => {
const Button = forwardRef((btnProps, ref) => {
const {
state: { button = {} },
} = useWindyTheme();
Expand Down Expand Up @@ -123,7 +123,7 @@ const Button = (btnProps, ref) => {
{props.children}
</button>
);
};
});

Button.propTypes = {
size: PropTypes.oneOf(["xs", "sm", "md", "lg", "xl"]),
Expand All @@ -148,4 +148,4 @@ Button.propTypes = {
children: PropTypes.any,
};

export default forwardRef(Button);
export default Button;
6 changes: 3 additions & 3 deletions src/components/Form/Checkbox/Checkbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { overrideTailwindClasses } from "tailwind-override";
import { generateDisabled } from "../../../Utils/Utils";
import { useWindyTheme } from "../../../context.jsx";

const Checkbox = (checkboxProps, ref) => {
const Checkbox = forwardRef((checkboxProps, ref) => {
const {
state: { checkbox = {} },
} = useWindyTheme();
Expand Down Expand Up @@ -93,7 +93,7 @@ const Checkbox = (checkboxProps, ref) => {
{label && <div className="select-none">{label}</div>}
</label>
);
};
});
Checkbox.propTypes = {
className: PropTypes.string,
shadow: PropTypes.bool,
Expand All @@ -113,4 +113,4 @@ Checkbox.propTypes = {
]),
};

export default forwardRef(Checkbox);
export default Checkbox;
6 changes: 3 additions & 3 deletions src/components/Form/Input/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useWindyTheme } from "../../../context.jsx";
//Utils
import { generateShadow } from "../../../Utils/Utils";

const Input = (inputProps, ref) => {
const Input = forwardRef((inputProps, ref) => {
const {
state: { input = {} },
} = useWindyTheme();
Expand Down Expand Up @@ -174,7 +174,7 @@ const Input = (inputProps, ref) => {
</div>
</>
);
};
});
Input.propTypes = {
className: PropTypes.string,
fullWidth: PropTypes.bool,
Expand All @@ -196,4 +196,4 @@ Input.propTypes = {
]),
};

export default forwardRef(Input);
export default Input;
6 changes: 3 additions & 3 deletions src/components/Form/Radio/Radio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { overrideTailwindClasses } from "tailwind-override";
import { generateDisabled } from "../../../Utils/Utils";
import { useWindyTheme } from "../../../context.jsx";

const Radio = (radioProps, ref) => {
const Radio = forwardRef((radioProps, ref) => {
const {
state: { radio = {} },
} = useWindyTheme();
Expand Down Expand Up @@ -106,7 +106,7 @@ const Radio = (radioProps, ref) => {
{label && <div className="select-none">{label}</div>}
</label>
);
};
});
Radio.propTypes = {
className: PropTypes.string,
shadow: PropTypes.bool,
Expand All @@ -124,4 +124,4 @@ Radio.propTypes = {
]),
};

export default forwardRef(Radio);
export default Radio;
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import Skeleton from "./components/Skeleton/Skeleton.jsx";
import Table from "./components/Table/Table.jsx";
import Tooltip from "./components/Tooltip/Tooltip.jsx";

import Tabs from "./components/Tabs/Tabs";
import Accordion from "./components/Accordion/Accordion";
import Tabs from "./components/Tabs/Tabs.jsx";
import Accordion from "./components/Accordion/Accordion.jsx";

import { WindyProvider, useWindyTheme, windyTheme } from "./context.jsx";

Expand Down

0 comments on commit a6a2153

Please sign in to comment.