prop:__Forces the value to be assigned as a DOM property instead of an HTML attribute. The declarative counterpart of setProperty; for the attribute-vs-property defaults see attributes / properties.
By default pota writes to attributes. That works for most props, but
some are only correctly read back from the DOM property — or don't
exist as attributes at all. Use prop:name when:
value and checked on form controls are the usual
suspectssrcObject on
<video>, files on <input type="file">, or a custom-element
property that expects an objectinnerText, textContent, innerHTMLAssigning null or undefined to a prop: sets the property to
null (not undefined) — some elements (notably <progress>) break
if you set their property to undefined.
A <textarea>'s attribute and property diverge once the user edits
it; prop:value writes the live property rather than the initial
attribute.
import { render } from 'pota'
function App() {
return (
<main>
<textarea value="set via attribute">content</textarea>
<hr />
<textarea prop:value="set via prop:">content</textarea>
</main>
)
}
render(App)