Widen a React component.
Widen a React component. Mostly useful for headers and footers that need to span the entire width of the screen.
npm install --save react-widen
import widen from 'react-widen'
import MyComponent from './MyComponent'
export default widen()(MyComponent)
Extends the left and right edges of the wrapped component by the specified amount.
- [
amount
] (string | number): The amount to extend the edges by. If a number is provided, the stringpx
is automatically appended. Defaults to1000px
.
To prevent horizontal scrolling, the <html>
and <body>
elements should have overflow-x: hidden
applied.
MIT