JSX attributes

attr:*

Edit this page

Migration

In Solid 1.x, you needed attr: to force a prop to be set as an HTML attribute rather than a DOM property. In Solid 2.0, attributes are the default for native elements, so you can simply use the attribute name directly.

// Solid 1.x
<my-element attr:status={props.status} />
// Solid 2.0
<my-element status={props.status} />

If you need to force a prop to be set as a DOM property instead of an attribute, use the prop:* prefix.

Report an issue with this page