Skip to content

Commit 59ea0c6

Browse files
committed
Fix errors in typings
1 parent 7d38756 commit 59ea0c6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/browser.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { hydrate } from 'react-dom';
2+
import * as ReactDOM from 'react-dom';
33
import App from './components/app';
44
import { propsUrl, containerId } from './constants';
55

@@ -8,6 +8,6 @@ fetch(propsUrl)
88
.then((props: AppProps) => {
99
const app = (<App {...props} />);
1010
const el = document.getElementById(containerId);
11-
const h = hydrate as any;
12-
h(app, el);
11+
const hydrate = ReactDOM.hydrate as any;
12+
hydrate(app, el);
1313
});

src/server.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createServer } from 'http';
22
import { createFactory } from 'react';
3-
import { renderToNodeStream } from 'react-dom/server';
3+
import * as ReactDomServer from 'react-dom/server';
44
import { readFile } from 'fs';
55
import { promisify } from 'util';
66
import AppComponent from './components/app';
@@ -33,6 +33,7 @@ createServer(async (req, res) => {
3333
<body>
3434
<div id="${containerId}">`);
3535
const props: AppProps = { items: getItems() };
36+
const renderToNodeStream = ReactDomServer.renderToNodeStream as any;
3637
const stream = renderToNodeStream(App(props)) as any;
3738
stream.pipe(res, { end: false });
3839
stream.on('end', () => {

0 commit comments

Comments
 (0)