How to use the react-grid-layout.defaultProps function in react-grid-layout

To help you get started, we’ve selected a few react-grid-layout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Zenika / marcel / backoffice / src / components / media / Grid / Grid.jsx View on Github external
const Grid = props => {
  const {
    size: { width, height },
    screenRatio,
    rows,
    cols,
    displayGrid,
  } = props
  const { layout, saveLayout, selectPlugin, selectedPlugin } = props
  const marginHeight = ReactGridLayout.defaultProps.margin[1]

  const containerRatio = width / height
  const gridWidth = containerRatio >= screenRatio ? screenRatio * height : width
  const gridHeight = containerRatio >= screenRatio ? height : width / screenRatio
  const rowHeight = (gridHeight - (rows + 1) * marginHeight) / rows

  return (
    <div>
      {displayGrid ? (
        <div style="{{">
          {range(rows).map(i =&gt; (
            <div>
              {range(cols).map(j =&gt; (
                <div>
              ))}
            </div></div></div></div>

react-grid-layout

A draggable and resizable grid layout with responsive breakpoints, for React.

MIT
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis