UNPKG

773 BTypeScriptView Raw
1import { FC, ReactNode } from 'react';
2export interface Props {
3 /**
4 * Function which transforms children output. It accepts children and must return transformed children too.
5 */
6 readonly transform: (children: string) => string;
7 readonly children?: ReactNode;
8}
9/**
10 * Transform a string representation of React components before they are written to output.
11 * For example, you might want to apply a gradient to text, add a clickable link or create some text effects.
12 * These use cases can't accept React nodes as input, they are expecting a string.
13 * That's what <Transform> component does, it gives you an output string of its child components and lets you transform it in any way.
14 */
15declare const Transform: FC<Props>;
16export default Transform;