© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Philip Davis
Software developer
You should let ReactJS do all the DOM manipulation for you. What are you trying to accomplish?
If you really need to mess with the DOM, an ideal place is in componentDidMount and then undo it in componentWillUnmount.
@pdavis For example like adding css/removing css for the component, listeners etc..
Lorefnon
Open Web Enthusiast
For such cases, re-rendering the component is almost always the best option.