From a6fd42c75817fac8d2b16488fd1da143acf1e4e8 Mon Sep 17 00:00:00 2001 From: Kevin Coughlin Date: Mon, 6 Jul 2015 21:47:37 -0400 Subject: [PATCH] Clarify React.render note in documentation --- docs/ref-01-top-level-api.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/ref-01-top-level-api.md b/docs/ref-01-top-level-api.md index 2689d6f1..81b7880b 100644 --- a/docs/ref-01-top-level-api.md +++ b/docs/ref-01-top-level-api.md @@ -88,10 +88,14 @@ If the ReactElement was previously rendered into `container`, this will perform If the optional callback is provided, it will be executed after the component is rendered or updated. > Note: +> +> `React.render()` controls the contents of the container node you pass in*. Any existing DOM elements +> inside are replaced when first called. Later calls use React’s DOM diffing algorithm for efficient +> updates. > -> `React.render()` replaces the contents of the container node you -> pass in. In the future, it may be possible to insert a component to an -> existing DOM node without overwriting the existing children. +> \* `React.render()` does not modify the container node (only modifies the children of the container). In +> the future, it may be possible to insert a component to an existing DOM node without overwriting +> the existing children. ### React.unmountComponentAtNode