Let’s say I have simple component in React and I want to use not only that component itself but the code of it as it is to show on screen ? How can I do that?
Here's what I m doing exactly
import Anything from ../../'anywhere';
const CustomComponent = () => {
return (
<div>
<Anything />
</div>
)
}
export default CustomComponent;
Then in another file
import CustomComponent from './custom-component';
return (
<div codeHighlightStr={CustomComponentString}>
<CustomComponent />
</div>
)
I don't know how to get CustomComponentString
from the same module