Skip to content

Commit 4d8acbf

Browse files
committed
Improve docs
1 parent 0301f17 commit 4d8acbf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ const MyContainer = styled(Overflow)`
111111
`;
112112
```
113113

114+
Any remaining props beyond those documented below will be passed along to the
115+
underlying DOM element. Use this to pass `className`, `style`, etc.
116+
114117
#### Props
115118

116119
<table>
@@ -174,6 +177,11 @@ grow to whatever size it needs to hold its content, and will cause the parent
174177
viewport element to overflow. It must be rendered inside an `<Overflow>`
175178
ancestor.
176179

180+
Although you can style this element directly by passing additional props like
181+
`className` and `style`, it’s preferably to include that style on your own
182+
element inside the `<Overflow.Content>` instead – otherwise you risk interfering
183+
with the styles this component needs to function.
184+
177185
#### Props
178186

179187
<table>

src/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ const emptyStyle = {};
8989
* max-height: 500px;
9090
* `;
9191
* ```
92+
*
93+
* Any remaining props beyond those documented below will be passed along to the
94+
* underlying DOM element. Use this to pass `className`, `style`, etc.
9295
*/
9396
export default function Overflow({
9497
children,
@@ -164,6 +167,11 @@ Overflow.propTypes = {
164167
* will grow to whatever size it needs to hold its content, and will cause the
165168
* parent viewport element to overflow. It must be rendered inside an
166169
* `<Overflow>` ancestor.
170+
*
171+
* Although you can style this element directly by passing additional props
172+
* like `className` and `style`, it’s preferably to include that style on your
173+
* own element inside the `<Overflow.Content>` instead – otherwise you risk
174+
* interfering with the styles this component needs to function.
167175
*/
168176
function OverflowContent({ children, style: styleProp, ...rest }) {
169177
const { dispatch, tolerance } = useContext(Context);

0 commit comments

Comments
 (0)