-
Notifications
You must be signed in to change notification settings - Fork 48.6k
Can I force react not to update dom between class renders? #5429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related #3965 |
@rpominov No, I don't think this is related. @blainekasten I think you want to have your render function produce an empty div and set the html in the callback ref. The following is untested, but is roughly the idea: This looks like a usage question, rather than a bug in the React core. Usage questions are better answered on sites like StackOverflow, as we try to use github issues for tracking bugs in the React core. For this reason, I'm going to close out this issue, but feel free to continue the conversation here or move it to StackOverflow. |
Right, maybe not. I just thought they have some |
I think it is a reparenting request.... Is there any work arounds to pulling off reparenting? @jimfb I tried your approach. What seems to happen is that on the re-renders the ref function argument is null.. which seems weird. So it's not really working. I did hack around and dive into the react internal instance to get the dom node and set the innerHTML but it's not working either.. |
You're trying to reparent some markup that wasn't generated by React. I think you're going to need to do that manually using javascript. You can probably remove the child node from the tree in |
Here's my problem.
Using react-router 1.0, i'm going to be re-rendering trees that are 90% the same. We use an external lib for an api that produces video mark up. Totally out of our hands. They modify the dom and that's how it has to be.
My problem comes in that when the routing changes, it re-renders the tree, and wipes out the custom DOM put in by the third party api.
I've tried things like returning false from
shouldComponentUpdate
always.. usingdangerouslySetInnerHtml={{__html: ''}}
to a blank string hoping that react would internally not do diff's on it.. nothing seems to work.Is there anything I can do to stop it?
The text was updated successfully, but these errors were encountered: