@wttech/graal-bridge-react
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

Graal Javascript renderer

Javascript execution entrypoint with React support.

Usage

Add dependency to package.json.

"dependencies": {
  "@wttech/graal-bridge": "1.0.0"
},

Inside the script import React components, register them and expose the render function.

// import the Graal templating bridge
import GraalBridgeReact from '@wttech/graal-bridge-react';

// import React components 
import ComponentA from 'ComponentA';
import ComponentB from 'ComponentB';

const templating = new TemplatingBridge();

// register React components
// render ComponentA with additional markup for rehydration
templating.registerReact('componentA', ComponentA);
// render ComponentB without the additional markup
templating.registerReactStatic('componentB', ComponentB);

// exposse the render function to be invoked by the Markuply engine
templating.expose();

License

Graal templating bridge is licensed under Apache License, Version 2.0.

Readme

Keywords

Package Sidebar

Install

npm i @wttech/graal-bridge-react

Weekly Downloads

1

Version

0.4.0

License

Apache-2.0

Unpacked Size

16.7 kB

Total Files

6

Last publish

Collaborators

  • tomasz.krug.wttech
  • igornapierala