Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React - renderSubtreeIntoContainer: Use case example

Tags:

reactjs

I've recently started using react and so far I'm enjoying it a lot.

However I'm struggling with the documentation.

I've seen some mentions of unstable_renderSubtreeIntoContainer / renderSubtreeIntoContainer mentioned here (github).

In which context would I use this? How would I use it?

Thanks a lot in advance!

like image 791
flaky Avatar asked May 19 '16 05:05

flaky


1 Answers

One of the use cases is "portals" - when you need to render a component outside the react app, but still control it as usual. For example - https://github.com/tajo/react-portal/blob/master/lib/portal.js#L135

like image 104
Kanstantsin K. Avatar answered Sep 28 '22 03:09

Kanstantsin K.