render() { // All middlewares that have called the .terminate() const $terminalComponents = this.props.children.filter( val => val.isTerminalResponse, ); // If atleast one middleware has called the .terminate, return null; if ($terminalComponents.length > 0) { return null; } // Else wrap the childern in an html element and render return createElement('html', this.props.html || {}, this.props.children); }
constructor(req, res, currentUrl) { super(); this._req = req; this.response = res; this._defaultErrorHandler = { errorHandler: true, component: createElement('div', {}, '404 Not Found'), }; this._currentUrl = currentUrl; routerConfig.type = 'node'; }
Router.run(routes, req.path, function(Handler) { var data = {authUser: req.session.user}; res.view('serverrendering', { markup: React.renderToString( React.createElement(Handler, data) ), initialData: JSON.stringify(data) }); });
/* Once we bootstrap the stores, we run react-router using Router.HistoryLocation The element is created and we just render it into the container */ Iso.bootstrap(function (state, _, container) { alt.bootstrap(state) Router.run(routes, Router.HistoryLocation, function (Handler) { var node = React.createElement(Handler) React.render(node, container) }) })
gulp.task('precompile', ['clean:html'], cb => { let App = require('./components/app'), React = require('react'), ReactDOM = require('react-dom/server'), htmlmin = require('gulp-htmlmin'); let stream = source(html_filename); stream.end(`<!DOCTYPE html>${ReactDOM.renderToStaticMarkup(React.createElement(App))}`); stream.pipe(streamify(gulpif(!debug, htmlmin({collapseWhitespace: true})))) .pipe(gulp.dest(html_dest)); log(`Destination HTML file written ${html_dest}${html_filename}`); cb(null); });
React.createClass({ displayName: 'GridForm', render: function() { return ( React.createElement("div", null, "Hello, world") ); } })
function (_super) { __extends(MyCustomTextarea, _super); function MyCustomTextarea() { return _super !== null && _super.apply(this, arguments) || this; } MyCustomTextarea.prototype.handleValueChange = function (e) { this.props.onChange(e.target.value); }; MyCustomTextarea.prototype.render = function () { return (React.createElement(react_textarea_autosize_1.default, { value: this.props.value, onChange: this.handleValueChange.bind(this) })); }; return MyCustomTextarea; }(React.Component)
React.render( React.createElement(Provider, {store: store}, function(){ return (<App/>) } ), document.getElementById('root') );
function renderBranding () { var brandingElement = React.createElement(BrandingTemplate, {branding: styleGuideConfig.pages.branding}) var brandingMarkup = ReactDOMServer.renderToStaticMarkup(brandingElement) var shellElement = React.createElement(ShellTemplate, { title: 'Branding', markup: brandingMarkup }) var html = ReactDOMServer.renderToStaticMarkup(shellElement) html = '<!doctype html>' + html fse.outputFileSync('./build/isg/branding/index.html', html) }
connect.io.on('connect', function() { Router.run(routes, Router.HistoryLocation, function(Handler) { ReactDOM.render( React.createElement(Handler), document.getElementById('content') ); }); });
function (_super) { __extends(App, _super); function App() { return _super !== null && _super.apply(this, arguments) || this; } App.prototype.render = function () { return (React.createElement(react_shadow_wrapper_1.default, null, React.createElement("span", null, "Matt"), React.createElement("br", null), React.createElement("span", null, "Landers"))); }; return App; }(React.Component)
React.createClass({ render: function() { return ( React.createElement('div', null, React.createElement('h1', null, this.props.title), React.createElement('div', {id: 'app'}, this.props.text) ) ); } })
render() { return React.createElement( "div", { className: "search" }, React.createElement(SearchBar, null), React.createElement("div", { className: "result" }) ); }
render(){ return( React.createElement('h1',null,'Hola perros') ) }
React.createClass({ render: function() { return ( React.createElement('div', null, React.createElement('h1', null, this.props.title), React.createElement('div', {id: 'app'}, this.props.text) ) ); } })