langateam / react-kendo

React Component Library for Kendo UI Widgets
62 stars 19 forks source link

Add Template.wrap convenience function #14

Closed davidjbeveridge closed 8 years ago

davidjbeveridge commented 8 years ago

This just adds a wrapper function that makes wrapping simple components as kendo templates even easier.

Example:

var Kendo = = require('react-kendo');
var Scheduler = Kendo.Scheduler;
var Template = Kendo.Template;

var HoursHeader = function (props) {
  return <div>{props.date}</div>;
};

<Scheduler options={
  majorTimeHeaderTemplate: Template.wrap(HoursHeader)
} />

I apologize that the example is somewhat contrived. But for components that will take the same props as the Kendo template would take, Template.wrap will save some overhead.