Add new convenience method which can render templates that are in the same folder as the view of a pagelet is specified in.
It can be possible that you want to do some manual fetching and processing of templates and pass the results of this in to the render callback of your get method.
var React = require('react')
, Pagelet = require('pagelet')
Pagelet.extend({
view: 'view.jsx',
get: function get(render) {
var pagelet = this;
var Component = React.createClass({
mixing: [Intl],
render: function () {
// new method
return pagelet.template('./my-component.jsx', {
FormattedMessage: React.FormattedMessage
});
}
});
return render(undefined, {
Component: Component,
intlData: { locale: 'us', messages: [{}] }
});
}
}).on(module);
Add new convenience method which can render templates that are in the same folder as the
view
of a pagelet is specified in.It can be possible that you want to do some manual fetching and processing of templates and pass the results of this in to the
render
callback of yourget
method.