* @param {ReactElement} element * @return {string} the HTML markup
(element, makeStaticMarkup)
| 13286 | * @return {string} the HTML markup |
| 13287 | */ |
| 13288 | function renderToStringImpl(element, makeStaticMarkup) { |
| 13289 | var transaction; |
| 13290 | try { |
| 13291 | ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy); |
| 13292 | |
| 13293 | transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup); |
| 13294 | |
| 13295 | return transaction.perform(function () { |
| 13296 | var componentInstance = instantiateReactComponent(element); |
| 13297 | var markup = componentInstance.mountComponent(transaction, null, ReactDOMContainerInfo(), emptyObject); |
| 13298 | if (!makeStaticMarkup) { |
| 13299 | markup = ReactMarkupChecksum.addChecksumToMarkup(markup); |
| 13300 | } |
| 13301 | return markup; |
| 13302 | }, null); |
| 13303 | } finally { |
| 13304 | ReactServerRenderingTransaction.release(transaction); |
| 13305 | // Revert to the DOM batching strategy since these two renderers |
| 13306 | // currently share these stateful modules. |
| 13307 | ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy); |
| 13308 | } |
| 13309 | } |
| 13310 | |
| 13311 | function renderToString(element) { |
| 13312 | !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : void 0; |
no test coverage detected
searching dependent graphs…