dioxus
dioxus copied to clipboard
`rsx` macro should prevent any children in self-closing elements
Feature Request
HTML includes several self-closing elements that are not designed to contain any child elements. Examples of such elements are:
<img src="image.jpg" alt="Description" />
<input type="text" name="username" />
Currently, the rsx!
macro in Dioxus allows content to be placed inside these self-closing elements:
pub fn component() -> Element {
rsx! {
img {"This is an image"}
}
}
Implement Suggestion
The rsx!
macro should produce an error if any content is nested inside self-closing elements. This would align the behavior of the macro with standard HTML practices and prevent potential rendering issues.