本文整理汇总了TypeScript中react.render函数的典型用法代码示例。如果您正苦于以下问题:TypeScript render函数的具体用法?TypeScript render怎么用?TypeScript render使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了render函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: render
window.addEventListener('load', () => {
render(MainApp({}), document.getElementById('app'));
}, false);
开发者ID:Karabur,项目名称:burn-up,代码行数:3,代码来源:app.ts
示例2: render
/// <reference path="../typings/tsd.d.ts" />
import * as React from 'react';
interface TextAreaCounterProps extends React.Props<any> {
text: string;
}
interface TextAreaCounterState {
}
class TextAreaCounter extends React.Component<TextAreaCounterProps, TextAreaCounterState>{
render(){
return React.DOM.div(null, React.DOM.textarea({
defaultValue: this.props.text
}), React.DOM.h3(null, this.props.text.length));
}
}
React.render(React.createElement(TextAreaCounter, {text: "Bob" }),
document.getElementById("app"));
开发者ID:Muhammmad-Zubaid,项目名称:learn-typed-react,代码行数:22,代码来源:index.ts
示例3: run
function run() {
render(
createElement(App, {}),
document.getElementById('app'))
}
开发者ID:duncanmak,项目名称:experiments,代码行数:5,代码来源:main.ts
示例4: render
/// <reference path="../typings/tsd.d.ts" />
import * as React from 'react';
interface MyComponentProps extends React.Props<any> {
name: string;
}
class MyComponent extends React.Component<MyComponentProps, {}>{
render(){
return React.DOM.span(null, this.props.name);
}
}
React.render(React.createElement(MyComponent, {name: "I'm so custom" }),
document.getElementById("app"));
开发者ID:Muhammmad-Zubaid,项目名称:learn-typed-react,代码行数:16,代码来源:index.ts
示例5: require
import * as React from 'react';
import * as Rx from 'rx';
import App from './app';
const RxDOM = require('rx-dom');
React.render(
React.createElement(App, {}),
document.getElementById('app'));
开发者ID:duncanmak,项目名称:experiments,代码行数:9,代码来源:main.ts
示例6: require
var React : any = require('react');
var AppComponent : any = require('./component/AppComponent.jsx');
var host = location.origin.replace(/^http/, 'ws');
React.render(
React.createElement(AppComponent,
{
'API' : host
}),
document.getElementById('content'));
开发者ID:aaronnech,项目名称:PokerServer,代码行数:11,代码来源:main.ts
示例7: Square
import * as React from 'react';
import Square from 'Square';
import View from 'View';
let square = new Square(5);
console.log('square area', square.size, square.getArea());
React.render(
React.createElement(View, {name: 'Priit', age: 23}),
document.getElementById('app')
);
开发者ID:kallaspriit,项目名称:travis,代码行数:13,代码来源:app.ts
示例8:
output$.subscribe((comp: React.ReactElement<any>) => {
React.render(
comp,
document.getElementById('app'))
});
开发者ID:duncanmak,项目名称:experiments,代码行数:5,代码来源:main.ts
示例9: require
// browserify.js (our library that clumps together all these javascript files)
// needs a "main file" to derive all dependencies from and package up.
// This is that file.
/// <reference path="../common/def/node.d.ts"/>
var React: any = require('react');
var AppComponent: any = require('./component/AppComponent.jsx');
React.render(
React.createElement(AppComponent),
document.getElementById('content')
);
开发者ID:rdrapeau,项目名称:TSBP,代码行数:13,代码来源:main.ts
示例10:
/**
* Created by shearerbeard on 6/16/15.
*/
///<reference path="../typings/references.d.ts"/>
import * as React from "react";
import {alt} from "./alt";
import {MainComponent} from "./components/Main";
React.render(
React.jsx(`<MainComponent />`),
document.getElementById("app")
);
开发者ID:Shearerbeard,项目名称:react-alt-typescript-boilderplate,代码行数:14,代码来源:app.ts
注:本文中的react.render函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论