<p dir="auto"><strong>TypeScript Version:</strong><br>
1.8.9</p>
<p dir="auto">React.__spread has been deprecated for a while, and has been removed in 15.0.<br>
(<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/facebook/react/commit/a142fd257803a218b5b9b2e76c327f0421b9b8b6/hovercard" href="https://github.com/facebook/react/commit/a142fd257803a218b5b9b2e76c327f0421b9b8b6">facebook/react@<tt>a142fd2</tt></a>)</p>
<p dir="auto">When upgrading a typescript project to React 0.15, an error is shown that <code class="notranslate">React.__spread is not defined</code> when using spread props.</p>
<p dir="auto">It looks like it'll be turned into a warning instead soon(<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/facebook/react/commit/fc1cfb6225f5c3af6843515363db63ed3dcbb824/hovercard" href="https://github.com/facebook/react/commit/fc1cfb6225f5c3af6843515363db63ed3dcbb824">facebook/react@<tt>fc1cfb6</tt></a>), but it's advisable to migrate tsx transformations from using <code class="notranslate">React.__spread</code> to using <code class="notranslate">Object.assign</code></p>
<p dir="auto"><strong>TypeScript Version:</strong><br>
1.8.10</p>
<p dir="auto">Node version :v4.2.2<br>
OS: OSX</p>
<p dir="auto"><strong>Code</strong></p>
<p dir="auto"><strong>Main.ts</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;./typings/node/node.d.ts&quot;/&gt;

import * as http from 'http';

namespace Scratch
{
    export class ServerWrapper {

        public constructor() {
            this.server = http.createServer();
        }

        public Start(handler :(request :http.ClientRequest, response :http.ClientResponse)=&gt;void) :void {
            this.server.listen(handler);
        }

        private server : http.Server;
    }
    var s = new Scratch.ServerWrapper();
    s.Start((req,res)=&gt;{});
}"><pre class="notranslate"><span class="pl-c">/// &lt;reference path="./typings/node/node.d.ts"/&gt;</span>

<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">http</span> <span class="pl-k">from</span> <span class="pl-s">'http'</span><span class="pl-kos">;</span>

<span class="pl-k">namespace</span> <span class="pl-smi">Scratch</span>
<span class="pl-kos">{</span>
    <span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">ServerWrapper</span> <span class="pl-kos">{</span>

        <span class="pl-k">public</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">server</span> <span class="pl-c1">=</span> <span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-en">createServer</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">public</span> <span class="pl-en">Start</span><span class="pl-kos">(</span><span class="pl-s1">handler</span> :<span class="pl-kos">(</span><span class="pl-s1">request</span> :<span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-smi">ClientRequest</span><span class="pl-kos">,</span> <span class="pl-s1">response</span> :<span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-smi">ClientResponse</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">)</span> :<span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">server</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-s1">handler</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">private</span> <span class="pl-c1">server</span> : <span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-smi">Server</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">var</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Scratch</span><span class="pl-kos">.</span><span class="pl-c1">ServerWrapper</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">s</span><span class="pl-kos">.</span><span class="pl-en">Start</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">req</span><span class="pl-kos">,</span><span class="pl-s1">res</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Compile with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tsc ./Main.ts --outFile /dev/stdout"><pre class="notranslate"><code class="notranslate">tsc ./Main.ts --outFile /dev/stdout
</code></pre></div>
<p dir="auto"><strong>Expected behavior:</strong> (what is emitted as Main.js when --outFile is not specified)</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;
var http = require('http');
var Scratch;
(function (Scratch) {
    var ServerWrapper = (function () {
        function ServerWrapper() {
            this.server = http.createServer();
        }
        ServerWrapper.prototype.Start = function (handler) {
            this.server.listen(handler);
        };
        return ServerWrapper;
    }());
    Scratch.ServerWrapper = ServerWrapper;
    var s = new Scratch.ServerWrapper();
    s.Start(function (req, res) { });
})(Scratch || (Scratch = {}));"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">http</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'http'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-v">Scratch</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-v">Scratch</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-v">ServerWrapper</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">function</span> <span class="pl-v">ServerWrapper</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">server</span> <span class="pl-c1">=</span> <span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-en">createServer</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
        <span class="pl-v">ServerWrapper</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">Start</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">handler</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">server</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-s1">handler</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">;</span>
        <span class="pl-k">return</span> <span class="pl-v">ServerWrapper</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-v">Scratch</span><span class="pl-kos">.</span><span class="pl-c1">ServerWrapper</span> <span class="pl-c1">=</span> <span class="pl-v">ServerWrapper</span><span class="pl-kos">;</span>
    <span class="pl-k">var</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Scratch</span><span class="pl-kos">.</span><span class="pl-c1">ServerWrapper</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">s</span><span class="pl-kos">.</span><span class="pl-en">Start</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">req</span><span class="pl-kos">,</span> <span class="pl-s1">res</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-v">Scratch</span> <span class="pl-c1">||</span> <span class="pl-kos">(</span><span class="pl-v">Scratch</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Actual behavior:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;./typings/node/node.d.ts&quot;/&gt;"><pre class="notranslate"><code class="notranslate">/// &lt;reference path="./typings/node/node.d.ts"/&gt;
</code></pre></div>