0

I am trying to unmount a component, but when I look in the React devtools, it looks like it will not be unmounted. In a project where I code in another language I am using a function which contains ReactDOM.unmountComponentAtNode(...). This function have I exported from my React project.

Is it not the correct way to unmount a component? How can I solve this.

RMT
  • 942
  • 2
  • 12
  • 32
  • what do you mean another language? how you get access to the ReactDOM? In your react project you should export or make available to a function that looks like this: export const unmountComponent = element => ReactDOM.unmountComponentAtNode(element) and then you can use it in another code – stasdes May 14 '20 at 09:07
  • Does this answer your question? [How to unmount, unrender or remove a component, from itself in a React/Redux/Typescript notification message](https://stackoverflow.com/questions/36985738/how-to-unmount-unrender-or-remove-a-component-from-itself-in-a-react-redux-typ) – ArtDev May 14 '20 at 09:29

0 Answers0