0.4.0 • Published 3 years ago

@wttech/graal-bridge-react v0.4.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

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.

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago