Skip to content

Commit

Permalink
LPS-103997 Destroy pages tree component when unmounting page type sel…
Browse files Browse the repository at this point in the history
…ector on navigation
  • Loading branch information
pavel-savinov authored and brianchandotcom committed Nov 13, 2019
1 parent 03f5671 commit 75ef5c6
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -13,9 +13,15 @@
*/

import PropTypes from 'prop-types';
import React, {useCallback} from 'react';
import React, {useCallback, useEffect} from 'react';

function PageTypeSelector(props) {
useEffect(() => {
return () => {
Liferay.destroyComponent(`${props.namespace}pagesTree`);
};
}, [props.namespace]);

const handleOnChange = useCallback(
event => {
const pageType = event.target.value;
Expand Down

0 comments on commit 75ef5c6

Please sign in to comment.