Skip to content

Commit e36648b

Browse files
committed
chore: put owned attributes after ...props in nanoviews-component skill
1 parent b24fcae commit e36648b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎skills/nanoviews-component/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ If the project's linter rejects this layout, or its `--fix` collapses it back, t
383383
component$((props: SomeProps) => ...)
384384
```
385385

386-
- Universal components must forward all remaining props to the root element, spreading `...props` after the attributes the component owns — see the reference `Button` above: `type`, `disabled`, `onClick` etc. reach `<button>` via the spread instead of being listed one by one.
386+
- Universal components must forward all remaining props to the root element, spreading `...props` after the attributes the component owns — see the reference `Button` above: `type`, `disabled`, `onClick` etc. reach `<button>` via the spread instead of being listed one by one. The exception is an attribute the component derives from its own prop and must not lose to a passed-in value, such as `aria-disabled` rendered from a `busy` prop: it goes after the spread, and the props type declares it `never`.
387387
- Don't pass unneeded props to the root element: destructure the props a helper consumes, which is what takes them out of the rest:
388388

389389
```js

0 commit comments

Comments
 (0)