E
E
Egor Trubnikov-Panov2015-01-17 11:21:50
JavaScript
Egor Trubnikov-Panov, 2015-01-17 11:21:50

Is it possible for React.renderComponent to replace the passed node instead of nesting inside it?

when I do this:
React.renderComponent( ReactClass, node);
A new DOM object is inserted into the passed node, and it overwrites everything that was inside.
I want nothing to be overwritten inside the node, but added to the existing one.
Or better yet, the node itself was replaced with a new DOM object.
Tell me, is there any way to control this in React?
As far as I understand. There is no such possibility, and this makes me very sad.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max Sysoev, 2015-01-18
@ColCh

Add the desired element via document.createElement \ node.appendChild and send the created element to renderComponent .
You may ask why are you doing this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question