Expected Behaviour
As stated in the documentation:
The DOM content will be moved when the React component is mounted. And, the content will be put back in its original location if the React component is later unmounted.
Actual Behaviour
After some tests, if the property holding the content (inside the react component) is not used, even if the react component is still mounted, the DOM content is still put back in its original location.
Sample Code that illustrates the problem
React component:
importReactfrom'react';importPropTypesfrom'prop-types';constExample=({// products,
title,
content,})=>(<divclassName="example"style={{backgroundColor: 'lightgrey'}}>{title==='yepe'&&content}{title!=='yepe'&&<p>Not the title I expected</p>}</div>);Example.propTypes={// products: PropTypes.arrayOf(PropTypes.object).isRequired,title: PropTypes.string,content: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node),PropTypes.node,]).isRequired,};Example.defaultProps={title: 'no',};exportdefaultExample;React container:
import{DOMModel,byAttrVal,byContent,}from'@adobe/react-webcomponent';import{connect}from'react-redux';importExamplefrom'../example/example';import{action}from'actions';constmapStateToProps=state=>({products: state.products,});constReduxedExample=connect(mapStateToProps,{ action },)(Example);classExampleModelextendsDOMModel{
@byAttrVal('title')title;
@byContent('.content')content;}// Register web component "example-component"// using above Model});Html example:
<example-componenttitle="yepe"><divclass="content">
This is the correct title!
</div></example-component>

Other html example:
<example-componenttitle="other title"><divclass="content">
This is the correct title!
</div></example-component>

Expected Behaviour
As stated in the documentation:
Actual Behaviour
After some tests, if the property holding the content (inside the react component) is not used, even if the react component is still mounted, the DOM content is still put back in its original location.
Sample Code that illustrates the problem
React component:
React container:
Html example:
Other html example: