Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 8066e80

Browse files
authored
Update typings for error messages prop
Allow to return JSX from messages object If I understood correctly, there is no restriction on messages object value, so you can return string or any other JSX elements: https://github.com/davidkpiano/react-redux-form/blob/master/src/components/errors-component.js#L33
1 parent 2fb5db0 commit 8066e80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

react-redux-form.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ interface ErrorsObject {
3939
[key: string]: boolean | string;
4040
}
4141
interface ErrorsMessageSelector {
42-
(val: any): string;
42+
(val: any): string | JSX.Element;
4343
}
4444
interface ErrorsComponentMessages {
45-
[key: string]: string | ErrorsMessageSelector;
45+
[key: string]: string | ErrorsMessageSelector | JSX.Element | bool;
4646
}
4747

4848
interface FormValidators {

0 commit comments

Comments
 (0)