Skip to content

Commit 975a069

Browse files
authored
Bugfix finalform (#3640)
* Revert "Reverterer endringer ifm finalform, som krasjet avdelingslederbildet for gamle køer" This reverts commit c8740fd. * default params
1 parent c8740fd commit 975a069

File tree

5 files changed

+6
-34
lines changed

5 files changed

+6
-34
lines changed

src/client/app/form/finalFields/CheckboxField.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,5 @@ const CheckboxField: FunctionComponent<OwnProps> = ({ name, label, validate, rea
4848
/>
4949
);
5050

51-
CheckboxField.defaultProps = {
52-
validate: null,
53-
readOnly: false,
54-
};
5551

5652
export default CheckboxField;

src/client/app/form/finalFields/DatepickerField.tsx

+3-11
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ interface OwnProps {
5353
*/
5454
const DatepickerField: FunctionComponent<OwnProps> = ({
5555
name,
56-
label,
56+
label = '',
5757
readOnly,
58-
format,
59-
parse,
58+
format = (value) => value,
59+
parse = (value) => value,
6060
isEdited,
6161
validate,
6262
...otherProps
@@ -76,12 +76,4 @@ const DatepickerField: FunctionComponent<OwnProps> = ({
7676
/>
7777
);
7878

79-
DatepickerField.defaultProps = {
80-
label: '',
81-
readOnly: false,
82-
isEdited: false,
83-
format: (value) => value,
84-
parse: (value) => value,
85-
};
86-
8779
export default DatepickerField;

src/client/app/form/finalFields/RadioOption.tsx

+3-12
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ interface OwnProps {
2323
*/
2424

2525
export const RadioOption: FunctionComponent<OwnProps> = ({
26-
name,
27-
className,
26+
name = '',
27+
className = '',
2828
label,
2929
value,
3030
actualValue,
3131
disabled,
3232
groupDisabled,
33-
onChange,
33+
onChange = () => undefined,
3434
children,
3535
style,
3636
manualHideChildren,
@@ -54,15 +54,6 @@ export const RadioOption: FunctionComponent<OwnProps> = ({
5454
);
5555
};
5656

57-
RadioOption.defaultProps = {
58-
name: '',
59-
className: '',
60-
disabled: false,
61-
groupDisabled: false,
62-
onChange: () => undefined,
63-
manualHideChildren: false,
64-
};
65-
6657
RadioOption.displayName = 'RadioOption';
6758

6859
export default RadioOption;

src/client/app/form/finalFields/ReadOnlyField.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,5 @@ export const ReadOnlyField: FunctionComponent<OwnProps> = ({ label, input, isEdi
3232
);
3333
};
3434

35-
ReadOnlyField.defaultProps = {
36-
label: undefined,
37-
isEdited: false,
38-
};
3935

4036
export default ReadOnlyField;

src/client/app/form/finalFields/TextAreaField.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ const TextAreaWithBadge: FunctionComponent<TextAreaWithBadgeProps & WrappedCompo
4444
</div>
4545
);
4646

47-
TextAreaWithBadge.defaultProps = {
48-
badges: null,
49-
};
5047

5148
const renderNavTextArea = renderNavField(injectIntl(TextAreaWithBadge));
5249

0 commit comments

Comments
 (0)