Skip to content

Commit 678e276

Browse files
authored
Revert "Allow Input component to render child components passed to it"
1 parent 3ff3e82 commit 678e276

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/components/input/Input.tsx

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { HTMLProps } from 'react';
2-
3-
import { FormElementProps } from '../../util/types/FormTypes';
2+
import classNames from 'classnames';
43
import FormGroup from '../../util/FormGroup';
54
import { InputWidth } from '../../util/types/NHSUKTypes';
6-
import classNames from 'classnames';
5+
import { FormElementProps } from '../../util/types/FormTypes';
76

87
interface InputProps extends HTMLProps<HTMLInputElement>, FormElementProps {
98
inputRef?: (inputRef: HTMLInputElement | null) => any;
@@ -14,19 +13,16 @@ interface InputProps extends HTMLProps<HTMLInputElement>, FormElementProps {
1413
const Input: React.FC<InputProps> = props => (
1514
<FormGroup<InputProps> {...props} inputType="input">
1615
{({ width, className, error, inputRef, ...rest }) => (
17-
<>
18-
<input
19-
className={classNames(
20-
'nhsuk-input',
21-
{ [`nhsuk-input--width-${width}`]: width },
22-
{ 'nhsuk-input--error': error },
23-
className,
24-
)}
25-
ref={inputRef}
26-
{...rest}
27-
/>
28-
{props.children}
29-
</>
16+
<input
17+
className={classNames(
18+
'nhsuk-input',
19+
{ [`nhsuk-input--width-${width}`]: width },
20+
{ 'nhsuk-input--error': error },
21+
className,
22+
)}
23+
ref={inputRef}
24+
{...rest}
25+
/>
3026
)}
3127
</FormGroup>
3228
);

0 commit comments

Comments
 (0)