Definitelytyped: [@types/react-dom] has to support [email protected]

Created on 27 Sep 2017  路  10Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the @types/xxxx package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @tkrotoff @MartynasZilinskas @andy-ms

Hello,

react-dom@16 introduces new hydrate() and other APIs. deprecates existing render() API.
Therefore, @types/react-dom need to apply react-dom@16's new changes.

Thank you.

Most helpful comment

There is a PR about this issue: #20065

All 10 comments

I had the same problem. I want to use "createPortal" method but doesn't exists in @types/react-dom 15.5.5

Looks like some work started here (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18453) but stalled.

renderToNodeStream is the method I'm looking to use

@cheerun a small correction, render() API is not deprecated, it's just that new hydrate() API is explicitly introduced to SSRed Apps.

Hydrating a server-rendered container now has an explicit API. If you're reviving server-rendered HTML, use ReactDOM.hydrate instead of ReactDOM.render. _Keep using ReactDOM.render_ if you're just doing client-side rendering.

@harshes53 Oh, Thank you for correction!

There is a PR about this issue: #20065

20065 has been merged, but the module hasn't been published yet.

@christian-schulze Waiting for the automatic publishing. Docs say it should be up within 24 hours of push

It's available now. You can see a working example here: https://github.com/styfle/react-server-example-tsx

Can confirm. We've now upgraded our app to react 16 with no type errors 馃憤

Was this page helpful?
0 / 5 - 0 ratings