Fixed no longer implicit children prop in FunctionalComponent type

This commit is contained in:
Alejandro Celaya
2022-04-24 10:39:11 +02:00
parent d5b1dc5bff
commit 271b19a4ec
28 changed files with 86 additions and 80 deletions

View File

@@ -1,3 +1,5 @@
import { FC } from 'react';
import { FC, PropsWithChildren } from 'react';
export const FormText: FC = ({ children }) => <small className="form-text text-muted d-block">{children}</small>;
export const FormText: FC<PropsWithChildren<unknown>> = ({ children }) => (
<small className="form-text text-muted d-block">{children}</small>
);

View File

@@ -1,8 +1,8 @@
import { FC } from 'react';
import { FC, PropsWithChildren } from 'react';
import { InputType } from 'reactstrap/types/lib/Input';
import { LabeledFormGroup } from './LabeledFormGroup';
export interface InputFormGroupProps {
export type InputFormGroupProps = PropsWithChildren<{
value: string;
onChange: (newValue: string) => void;
type?: InputType;
@@ -10,7 +10,7 @@ export interface InputFormGroupProps {
placeholder?: string;
className?: string;
labelClassName?: string;
}
}>;
export const InputFormGroup: FC<InputFormGroupProps> = (
{ children, value, onChange, type, required, placeholder, className, labelClassName },

View File

@@ -1,11 +1,11 @@
import { FC, ReactNode } from 'react';
import { FC, PropsWithChildren, ReactNode } from 'react';
interface LabeledFormGroupProps {
type LabeledFormGroupProps = PropsWithChildren<{
label: ReactNode;
noMargin?: boolean;
className?: string;
labelClassName?: string;
}
}>;
/* eslint-disable jsx-a11y/label-has-associated-control */
export const LabeledFormGroup: FC<LabeledFormGroupProps> = (