Allow both React nodes and strings to be passed as TextProps

Looking at the library it's perfectly fine to pass a React node as a TextProp.
The only exception to this is rowsText, since it's used inside of an
<option> element where only a string can be passed.
Also, because noDataText is wrapped in 'normalizeComponent' method, it
can be passed both as a React component as well as a React node.
This commit is contained in:
Niels de Bruin
2018-12-21 13:38:24 +01:00
committed by Niels de Bruin
parent f91a63c5e3
commit 8dc024a9c6

View File

@@ -362,22 +362,22 @@ export interface ComponentProps {
export interface TextProps {
/** Default: 'Previous' */
previousText: string;
previousText: React.ReactNode;
/** Default: 'Next' */
nextText: string;
nextText: React.ReactNode;
/** Default: 'Loading...' */
loadingText: string;
loadingText: React.ReactNode;
/** Default: 'No rows found' */
noDataText: string;
noDataText: React.ReactNode | React.ComponentType;
/** Default: 'Page' */
pageText: string;
pageText: React.ReactNode;
/** Default: 'of' */
ofText: string;
ofText: React.ReactNode;
/** Default: 'rows' */
rowsText: string;