Skip to content

Renders react components into existing DOM

Notifications You must be signed in to change notification settings

Tolkam-JS-Packages/lib-react-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tolkam/lib-react-renderer

Renders react components into existing DOM.

Usage

import { ReactDOMFactory, Container, Renderer } from '@tolkam/lib-react-renderer';

const componentFactory = new ReactDOMFactory();
const componentsContainer = new Container(componentFactory);
const renderer = new Renderer(componentsContainer);

// register components
componentsContainer.register('MyComponent', () => {
    return <div>Hello, World!</div>;
});

// somewhere in html put "<div data-rr="MyComponent"></div>"

// mount registered components
renderer.mount(document.body);

Documentation

The code is rather self-explanatory and API is intended to be as simple as possible. Please, read the sources/Docblock if you have any questions. See Usage for quick start.

License

Proprietary / Unlicensed 🤷

About

Renders react components into existing DOM

Resources

Stars

Watchers

Forks

Packages

No packages published