You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need some element only have html, and do not need data-reactid.
But I don't except i should render two element with different function( e.g. renderToStaticMarkup, renderToString) and combine it because the element could be include by many element. Render split and combine could cause mistake when element is much more.
What you are looking for is shouldComponentUpdate. If shouldComponentUpdate returns false, that tells React that your component doesn't need to rerender.
For future reference, this is 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.
Thanks your reply, but the server side render useing renderToString will not call shouldComponentUpdate.
And i will move this topic into StackOverflow, many thanks.
I need some element only have html, and do not need data-reactid.
But I don't except i should render two element with different function( e.g. renderToStaticMarkup, renderToString) and combine it because the element could be include by many element. Render split and combine could cause mistake when element is much more.
If i could set an attribute in compoment:
or a new pure html Compoment
If i write as above, the render function can auto swap render function to render elements.
Is there any graceful solution?
The text was updated successfully, but these errors were encountered: