Home/Docs/Common Mistakes
Advanced

Common Mistakes

OlumJS intentionally has no naked braces and one way to do each thing. These do not work:

✗ Don't write✓ Write insteadWhy
when={x} / each={x}when="x" / each="x"values live in ""
value={state.x}value="{state.x}"string attr + {}
oninput={(e)=>…}oninput="(e)=>…"events in ""
<Comp {a} /><Comp a="{a}" />no shorthand
<Comp a={a} /><Comp a="{a}" />no naked-brace prop
<img {src} /><img src="{src}" />no shorthand
:style="{…}"style="color:{x}; …"string style + {}
:title="x"title="{x}"string attr + {}
model="state.x"value="{state.x}" + oninputbind manually
mode="prevent"e.preventDefault() in the handlerno modifiers
literal { in text{String.fromCharCode(123)}any {…} is interpolated
<comp/><Comp/>components are PascalCase