Passing data to templates
Example 1: Simple Property Passing
const transformHook = (rw) => {
const message = 'Hello, World!';
rw.setProps({
greetingMessage: message
});
};
exports.transformHook = transformHook;Example 2: Conditional Logic for Display
const transformHook = (rw) => {
const { isVisible } = rw.props;
const display = isVisible ? 'visible' : 'hidden';
rw.setProps({
display
});
};
exports.transformHook = transformHook;Example 3: Basic Computation and Formatting
Example 4: String Manipulation
Example 5: Complex Calculation using collection data
Last updated
Was this helpful?

