Sheath rule
native-model-on-non-input
NativePHP model directives must target elements that can synchronize a changed
value.
#Why
Two-way binding requires an element that dispatches a change value. Layout, display, chrome, and child-component tags cannot establish that synchronization path.
#Examples
#Bad
{{-- column cannot emit the value needed for two-way binding. --}}
<native:column native:model="query">
<native:text>Search</native:text>
</native:column>
#Good
{{-- text-input can synchronize query on change. --}}
<native:text-input native:model.debounce.150ms="query" />
{{-- Legacy @model also works on a change-capable input. --}}
<native:toggle @model="enabled" />
#Supported Targets
Registered elements that expose compatible change handling can receive a model binding, including plugin elements.
Registered child components are rejected. Pass a prop and emit a custom event
instead of using native:model on the component tag.
#Options
All NativePHP rules accept nativeViewPaths. The default is
['views/native/']. See Native View Detection
for path configuration.
#See Also
Related rules validate the binding syntax and destination property:
- native-model-modifier: Check directive spelling and modifiers
- native-model-property: Check the owning component property
- native-unsupported-event: Check direct event bindings