I'm building a component that will use a native html type as its root element. For simplicity, let's say either a <td> or <th>. Doing this with user-defined components is easy since they are just functions that can be passed:
function MyWrapper(props) {
const Element = props.element;
<Element ...>
...
</Element>
}
<MyWrapper element={MyComponent} />
But how can you pass a native html type, like <td> as element? I can get this to work if I define a silly wrapper function for each type I may want to pass in, e.g.:
const th = props => <th {...props} />;
<MyWrapper element={th} />
But I feel like I'm missing something about jsx by needing to define a function for a built-in component. Is there a another way to reference a dynamic but built-in component type without defining wrappers around a bunch of native html components?
