Sheath rule
native-discarded-markup
Native views must not rely on wrappers and raw HTML that disappear from native
output.
#Why
NativePHP emits recognized native elements, not ordinary HTML wrappers. The wrapper's attributes and layout therefore disappear even when native descendants still render.
#Examples
#Bad
{{-- div and its classes do not appear in native output. --}}
<native:column>
<div class="p-4">
<native:text>Account</native:text>
</div>
</native:column>
#Good
{{-- column carries the layout class into native output. --}}
<native:column class="p-4">
<native:text>Account</native:text>
</native:column>
{{-- Registered webview slots preserve their raw HTML. --}}
<native:webview>
<main><h1>Web content</h1></main>
</native:webview>
#Options
All NativePHP rules accept nativeViewPaths. The default is
['views/native/']. See Native View Detection
for path-only detection.
#Notes
Blade components and registered native: child components are excluded.
Rendered native output inside a child-component tag is treated as unsupported
slot content instead of discarded HTML.
#See Also
Related rules identify invalid native tags and component content:
- native-unknown-element: Check prefixed tags and native nesting
- native-component-slot-content: Check child-component slots