I made the following component. It doesn't seem perfect as it requires to also define parent of the potential wrapper element and both types and properties are passed as 'props' instead of using pure HTML, but it should work.
Usage example below.
WRAPPED