close
Skip to content

Commit b06a60f

Browse files
committed
Fix docs to match rule behavior
1 parent 0663429 commit b06a60f

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

‎packages/eslint-plugin/docs/rules/no-unmerged-classname.md‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function Foo( { padding, ...restProps } ) {
1818
```
1919

2020
```jsx
21-
// className destructured but not included in the className expression
22-
function Foo( { className, ...restProps } ) {
23-
return <div className={ clsx( styles.foo ) } { ...restProps } />;
21+
// Props not destructured — spread of entire props object
22+
function Foo( props ) {
23+
return <div className={ styles.foo } { ...props } />;
2424
}
2525
```
2626

@@ -39,3 +39,14 @@ function Foo( { ...restProps } ) {
3939
return <div className={ styles.foo } />;
4040
}
4141
```
42+
43+
```jsx
44+
// className forwarded on a different element than the one with spread — not flagged
45+
function Foo( { className, style, ...props } ) {
46+
return (
47+
<Outer className={ clsx( styles.outer, className ) } style={ style }>
48+
<Inner className={ styles.inner } { ...props } />
49+
</Outer>
50+
);
51+
}
52+
```

0 commit comments

Comments
 (0)