Remove default props usage
This commit is contained in:
@@ -34,7 +34,3 @@ export const OptionsPanel: React.FC<IProps> = ({ open, onClose, children, minHei
|
||||
<Box>{children}</Box>
|
||||
</Drawer>
|
||||
);
|
||||
|
||||
OptionsPanel.defaultProps = {
|
||||
minHeight: undefined,
|
||||
};
|
||||
|
||||
@@ -53,7 +53,3 @@ export const OptionsTabs = <T extends string = string>({
|
||||
</OptionsPanel>
|
||||
);
|
||||
};
|
||||
|
||||
OptionsTabs.defaultProps = {
|
||||
minHeight: undefined,
|
||||
};
|
||||
|
||||
@@ -44,9 +44,9 @@ interface IProps {
|
||||
export function LangSelect(props: IProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { shownLangs, setShownLangs, allLangs, forcedLangs } = props;
|
||||
const { shownLangs, setShownLangs, allLangs, forcedLangs = [] } = props;
|
||||
// hold a copy and only sate state on parent when OK pressed, improves performance
|
||||
const [mShownLangs, setMShownLangs] = useState(removeAll(cloneObject(shownLangs), forcedLangs!));
|
||||
const [mShownLangs, setMShownLangs] = useState(removeAll(cloneObject(shownLangs), forcedLangs));
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
|
||||
const handleCancel = () => {
|
||||
@@ -120,7 +120,3 @@ export function LangSelect(props: IProps) {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
LangSelect.defaultProps = {
|
||||
forcedLangs: [] as string[],
|
||||
};
|
||||
|
||||
@@ -23,7 +23,3 @@ export function EmptyViewAbsoluteCentered({ sx, ...emptyViewProps }: EmptyViewPr
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
EmptyViewAbsoluteCentered.defaultProps = {
|
||||
messageExtra: undefined,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user