-
I tried this, but failed with an error import { render } from "solid-js/web";
function Element() {
const DynamicElement = 'div'
return (
<DynamicElement>
content
</DynamicElement>
);
}
render(() => <Element />, document.getElementById("app")); |
Beta Was this translation helpful? Give feedback.
Answered by
atk
Sep 3, 2021
Replies: 2 comments 1 reply
-
May be const DynamicElement = (props) => <div>{props.children}</div> |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have a look at https://www.solidjs.com/docs/latest/api#%3Cdynamic%3E – it does exactly what you want. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Cweili
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have a look at https://www.solidjs.com/docs/latest/api#%3Cdynamic%3E – it does exactly what you want.