We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f7ec3f commit ccb854fCopy full SHA for ccb854f
ux-variations/05.wrapper-components.md
@@ -20,5 +20,20 @@ const Parent = () => {
20
</div>
21
};
22
```
23
+
24
+FYI - Wrapper component can also be made accept a tag name and then used to generate the HTML element.
25
+However, usually this is not recommended because you can't add attributes/props to it.
26
27
+```javascript
28
+const SampleComponent = () => {
29
+ <Wrap tagName="div" content="Hello World" />
30
+};
31
32
+const Wrap = ({ tagName, content }) => {
33
+ const Tag = `${tagName}` // variable name must begin with capital letters
34
+ return <Tag>{content}</Tag>
35
+}
36
+```
37
38
### Related links:
39
- [Slides from my talk: Building Multi-tenant UI with React](https://speakerdeck.com/vasa/building-multitenant-ui-with-react-dot-js)
0 commit comments