@hophiphip/react-renderer-provider
v1.0.30
Published
Share common definition for data renderers and editors
Downloads
181
Readme
React renderer provider
Share common definition for data renderers and editors.
Installation
npm i @hophiphip/react-renderer-provider
Install peer dependencies if necessary
npm i react react-dom
Usage
import DataRendererProvider from '@hophiphip/react-renderer-provider';
declare module '@hophiphip/react-renderer-provider' {
export interface Api {
t: (key: string) => string;
}
export interface Schema extends JSONSchema7 {
value_prop?: string;
}
}
const renderers = [
/* Renderers definitions ... */
];
const api = {
/* Custom API definition ... */
};
export default () => {
return (
<DataRendererProvider renderers={renderers} api={api}>
{/* ... */}
</DataRendererProvider>
)
}
Examples
See the examples
directory.