本文整理匯總了TypeScript中react.renderComponent函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript renderComponent函數的具體用法?TypeScript renderComponent怎麽用?TypeScript renderComponent使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了renderComponent函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: updateMetadataEditor
export function updateMetadataEditor () : void {
var mdnode = document.getElementById("metadata");
if (selection.cardinality() !== 1) {
React.unmountComponentAtNode(mdnode);
return;
}
var mnode = $(selection.get()).children(".meta");
if (mnode.length === 0) {
mnode = $('<div class="meta" data-tag="meta" />');
$(selection.get()).append(mnode);
}
if (mnode.length === 1) {
React.renderComponent(MetaKeysContainer({ backing: mnode.get(0),
typeSpec: metadataTypeSpec,
vm: visibilityMap,
name: "meta" }),
mdnode);
} else if (mnode.length > 1) {
throw new Error("Too many meta nodes: " + selection.get().outerHTML);
}
}
示例2: require
///<reference path='../typings/node.d.ts' />
var Hat = require('./hat');
var Hello:any = require('./hello').Hello;
var React:any = require('react');
var hat = new Hat("World");
var str = hat.go();
React.renderComponent(Hello({name: str}), document.getElementById('app'));
示例3: require
declare var require, document;
var Hat = require('./hat');
var Hello:any = require('./hello').Hello;
var React:any = require('react');
var hat = new Hat('World');
var str = hat.go();
React.renderComponent(Hello({name: str}), document.body);
示例4: require
///<reference path="../api/node/node.d.ts" />
var Button:any = require('./button').Button;
var React:any = require('react');
React.renderComponent(Button({name: 'Evan'}), document.getElementById('button'));