Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove defaultProps from React package #223

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions packages/react/src/components/LanguagePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useTX from '../hooks/useTX';
*
* - className: the CSS class to use on the <select> tag */

export default function LanguagePicker({ className }) {
export default function LanguagePicker({ className = '' }) {
const languages = useLanguages();
const locale = useLocale();
const tx = useTX();
Expand All @@ -31,7 +31,3 @@ export default function LanguagePicker({ className }) {
LanguagePicker.propTypes = {
className: PropTypes.string,
};

LanguagePicker.defaultProps = {
className: '',
};
2 changes: 0 additions & 2 deletions packages/react/src/components/T.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ export default function T({ _str, ...props }) {
return useT()(_str, props);
}

T.defaultProps = {};

T.propTypes = { _str: PropTypes.string.isRequired };
6 changes: 1 addition & 5 deletions packages/react/src/components/UT.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useT from '../hooks/useT';
* `div` or a `span`.
* */

export default function UT({ _str, _inline, ...props }) {
export default function UT({ _str, _inline = false, ...props }) {
const translation = useT()(
_str,
{ _inline, _escapeVars: true, ...props },
Expand All @@ -28,10 +28,6 @@ export default function UT({ _str, _inline, ...props }) {
return React.createElement(parent, parentProps);
}

UT.defaultProps = {
_inline: false,
};

UT.propTypes = {
_str: PropTypes.string.isRequired,
_inline: PropTypes.bool,
Expand Down
Loading