Skip to content

Commit

Permalink
fix: Replace default props with default function arguments, to prep f…
Browse files Browse the repository at this point in the history
…or React 19
  • Loading branch information
joncursi committed May 30, 2024
1 parent 7fed2d1 commit ea0832e
Show file tree
Hide file tree
Showing 46 changed files with 12 additions and 443 deletions.
5 changes: 0 additions & 5 deletions src/components/AppBarNavigation/RenderLogo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,4 @@ const RenderLogo: FC<RenderLogoProps> = ({
return children;
};

RenderLogo.defaultProps = {
LinkComponent: undefined,
LinkProps: undefined,
};

export default RenderLogo;
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,4 @@ const RenderNavigationItem: FC<RenderNavigationItemProps> = ({
);
};

RenderNavigationItem.defaultProps = {
isActive: undefined,
LinkComponent: undefined,
};

export default RenderNavigationItem;
6 changes: 0 additions & 6 deletions src/components/AppBarNavigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,4 @@ export const AppBarNavigation: FC<AppBarNavigationProps> = ({
</StyledAppBar>
);

AppBarNavigation.defaultProps = {
appBarHeight: undefined,
AppBarProps: undefined,
headerRightElement: undefined,
};

export default AppBarNavigation;
20 changes: 0 additions & 20 deletions src/components/AreaChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,4 @@ export const AreaChart: React.FC<AreaChartProps> = (
);
};

AreaChart.defaultProps = {
areaChartProps: undefined,
areaProps: undefined,
children: undefined,
colors: undefined,
height: undefined,
legendProps: undefined,
responsiveContainerProps: undefined,
showLegend: undefined,
tooltipProps: undefined,
width: undefined,
xAxisProps: undefined,
xLabel: undefined,
xLabelProps: undefined,
yAxisProps: undefined,
yLabel: undefined,
yLabelProps: undefined,
yReferenceValue: undefined,
};

export default AreaChart;
12 changes: 0 additions & 12 deletions src/components/BarChart/CustomTooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,4 @@ export const CustomTooltip: React.FC<CustomToolTipProps> = (
return null;
};

CustomTooltip.defaultProps = {
barId: undefined,
data: undefined,
formatLabel: undefined,
formatValue: undefined,
formatValueLabel: undefined,
renderAdditionalInfo: undefined,
showValue: undefined,
tooltipColor: undefined,
valueLabel: undefined,
};

export default CustomTooltip;
8 changes: 0 additions & 8 deletions src/components/BarChart/CustomizedAxisTick/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,4 @@ export const CustomizedAxisTick: React.FC<CustomizedAxisTickProps> = ({
);
};

CustomizedAxisTick.defaultProps = {
onClick: undefined,
payload: undefined,
textWidth: undefined,
variant: undefined,
yAxisLabelTypographyProps: undefined,
};

export default CustomizedAxisTick;
30 changes: 0 additions & 30 deletions src/components/BarChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,34 +354,4 @@ export const BarChart: React.FC<BarChartProps> = (
);
};

BarChart.defaultProps = {
barKeys: undefined,
barProps: undefined,
cartesianGridProps: undefined,
chartProps: undefined,
children: undefined,
colors: undefined,
containerRef: undefined,
containerStyles: undefined,
customizeBarFillColor: undefined,
customizedAxisTickProps: undefined,
height: undefined,
labelListProps: undefined,
maxHeight: undefined,
parentHeight: undefined,
responsiveContainerProps: undefined,
setTooltipBarId: undefined,
subLabelProps: undefined,
subLabels: undefined,
subLabelWidth: undefined,
tooltipBarId: undefined,
tooltipProps: undefined,
UnhoveredTooltipComponent: undefined,
variant: undefined,
width: undefined,
xAxisProps: undefined,
yAxisLabelTypographyProps: undefined,
yAxisProps: undefined,
};

export default BarChart;
14 changes: 3 additions & 11 deletions src/components/ConfirmDialog/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export const ConfirmDialog = (props: ConfirmDialogProps): ReactElement => {
onCancel,
onConfirm,
onClose,
title,
title = 'Confirmation',
description,
content,
confirmationText,
cancellationText,
confirmationText = 'Ok',
cancellationText = 'Cancel',
dialogProps,
confirmationButtonProps,
cancellationButtonProps,
Expand Down Expand Up @@ -156,12 +156,4 @@ export const ConfirmDialog = (props: ConfirmDialogProps): ReactElement => {
);
};

ConfirmDialog.defaultProps = {
allowClose: true,
cancellationText: 'Cancel',
confirmationText: 'Ok',
isOpen: false,
title: 'Confirmation',
} as ConfirmDialogProps;

export default ConfirmDialog;
10 changes: 0 additions & 10 deletions src/components/CountyMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,4 @@ export const CountyMap: React.FC<CountyMapProps> = ({
);
};

CountyMap.defaultProps = {
mapPopupProps: undefined,
mapProps: undefined,
onHoverInfo: undefined,
processDataFn: undefined,
selectedCounty: undefined,
setOnHoverInfo: undefined,
tooltipElement: undefined,
};

export default CountyMap;
8 changes: 1 addition & 7 deletions src/components/DataTable/TableCellHead/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface TableCellHeadProps extends TableCellProps {
export const TableCellHead: FC<TableCellHeadProps> = ({
classes: classesProp,
children,
color,
color = 'default',
currentSortObject,
onChangeSort,
sortBy,
Expand Down Expand Up @@ -121,10 +121,4 @@ export const TableCellHead: FC<TableCellHeadProps> = ({
);
};

TableCellHead.defaultProps = {
color: 'default',
sortBy: undefined,
style: undefined,
};

export default TableCellHead;
4 changes: 0 additions & 4 deletions src/components/DataTable/TableContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ const TableContainer: FC<TableContainerProps> = (
<MuiTableContainer component={Component} {...props} />
);

TableContainer.defaultProps = {
component: undefined,
};

export default TableContainer;
14 changes: 1 addition & 13 deletions src/components/DataTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface DataTableProps<T> {
}

export const DataTable = <T,>({
color,
color = 'default',
columns,
currentSortObject,
emptyStateProps,
Expand Down Expand Up @@ -144,16 +144,4 @@ export const DataTable = <T,>({
</TableContainer>
);

DataTable.defaultProps = {
color: 'default',
emptyStateProps: undefined,
limit: undefined,
offset: undefined,
onChangeLimit: undefined,
onChangeOffset: undefined,
rowsPerPageOptions: undefined,
RowWrapper: undefined,
totalCount: undefined,
};

export default DataTable;
5 changes: 0 additions & 5 deletions src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,4 @@ export function Dialog({
);
}

Dialog.defaultProps = {
onClose: undefined,
title: undefined,
};

export default Dialog;
11 changes: 0 additions & 11 deletions src/components/EmptyState/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,4 @@ export const EmptyState: FC<EmptyStateProps> = ({
);
};

EmptyState.defaultProps = {
buttonProps: undefined,
description: undefined,
descriptionTypographyProps: undefined,
Icon: undefined,
iconProps: undefined,
style: undefined,
title: undefined,
titleTypographyProps: undefined,
};

export default EmptyState;
7 changes: 0 additions & 7 deletions src/components/FormCheckbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,4 @@ export function FormCheckbox({
);
}

FormCheckbox.defaultProps = {
formControlProps: undefined,
fullWidth: undefined,
labelProps: undefined,
value: undefined,
};

export default FormCheckbox;
8 changes: 0 additions & 8 deletions src/components/FormInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,4 @@ export function FormInput({
);
}

FormInput.defaultProps = {
errorMessage: undefined,
formControlProps: undefined,
helpText: undefined,
label: undefined,
labelProps: undefined,
};

export default FormInput;
4 changes: 0 additions & 4 deletions src/components/FormRadio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,4 @@ export function FormRadio({
);
}

FormRadio.defaultProps = {
labelProps: undefined,
};

export default FormRadio;
6 changes: 0 additions & 6 deletions src/components/FormRadioGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,4 @@ export function FormRadioGroup({
);
}

FormRadioGroup.defaultProps = {
formControlProps: undefined,
helpText: undefined,
inputLabelProps: undefined,
};

export default FormRadioGroup;
10 changes: 0 additions & 10 deletions src/components/FormSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,4 @@ export function FormSelect({
);
}

FormSelect.defaultProps = {
errorMessage: undefined,
formControlProps: undefined,
helpText: undefined,
labelProps: undefined,
options: [],
placeholder: undefined,
placeholderIsDisabled: undefined,
};

export default FormSelect;
7 changes: 0 additions & 7 deletions src/components/FormSwitch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,4 @@ export function FormSwitch({
);
}

FormSwitch.defaultProps = {
formControlProps: undefined,
fullWidth: undefined,
labelProps: undefined,
value: undefined,
};

export default FormSwitch;
10 changes: 0 additions & 10 deletions src/components/GeomarketMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,4 @@ export const GeomarketMap: React.FC<GeomarketMapProps> = ({
);
};

GeomarketMap.defaultProps = {
mapPopupProps: undefined,
mapProps: undefined,
onHoverInfo: undefined,
processDataFn: undefined,
selectedGeomarket: undefined,
setOnHoverInfo: undefined,
tooltipElement: undefined,
};

export default GeomarketMap;
5 changes: 0 additions & 5 deletions src/components/GridGenerator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,4 @@ export const GridGenerator: FC<GridGeneratorProps> = ({
</>
);

GridGenerator.defaultProps = {
gridContainerProps: undefined,
gridItemProps: undefined,
};

export default GridGenerator;
11 changes: 0 additions & 11 deletions src/components/HeatMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,4 @@ export const HeatMap: React.FC<HeatMapProps> = (
);
};

HeatMap.defaultProps = {
color: undefined,
data: undefined,
mapPopupProps: undefined,
mapProps: undefined,
onHoverInfo: undefined,
setOnHoverInfo: undefined,
sourceId: undefined,
tooltipElement: undefined,
};

export default HeatMap;
8 changes: 0 additions & 8 deletions src/components/IdleTimer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,4 @@ export const IdleTimer: FC<IdleTimerProps> = ({
return null;
};

IdleTimer.defaultProps = {
children: undefined,
onAction: undefined,
onActive: undefined,
onIdle: undefined,
stopOnIdle: undefined,
};

export default IdleTimer;
6 changes: 1 addition & 5 deletions src/components/InputLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const InputLabel: FC<InputLabelProps> = ({
children,
required,
helpText,
helpPlacement,
helpPlacement = 'right',
...otherProps
}: InputLabelProps): ReactElement<InputLabelProps> => (
<StyledInputLabel classes={classesProp} {...otherProps}>
Expand All @@ -62,8 +62,4 @@ export const InputLabel: FC<InputLabelProps> = ({
</StyledInputLabel>
);

InputLabel.defaultProps = {
helpPlacement: 'right',
} as InputLabelProps;

export default InputLabel;
Loading

0 comments on commit ea0832e

Please sign in to comment.