Mobiledoc Renderer for React
A Mobiledoc renderer for React written with Typescript
Allows injection of custom React components for greater control over the rendering and uses a plugin-type pattern allowing for easy extension and customization.
Warning This is pre-production code and still under active development. Use at your own risk.
Table of Contents
Installation
Install the module using npm install
:
npm install react-mobiledoc-renderer
Usage
To use the module, simply import
it into your code and use as follows:
import Renderer from 'react-mobiledoc-renderer';
const renderer = new Renderer({
// ...see below for options
});
const mobiledoc = {
// mobiledoc document object
};
// note that the .render() method is async
const { result } = await renderer.render(mobiledoc);
// the `result` is a React element
return <article>{result}</article>;