當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript react.render函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。