How to use the gestalt.ExperimentalMasonry.createMeasurementStore function in gestalt

To help you get started, we’ve selected a few gestalt 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 pinterest / gestalt / test / containers / ExperimentalMasonryExample.js View on Github external
import React from 'react';
import { ExperimentalMasonry as Masonry } from 'gestalt';
import Item from './ExampleGridItem';
import PropTypes from 'prop-types';

const store = Masonry.createMeasurementStore();

const getRandomColor = () => {
  const letters = '0123456789ABCDEF';
  let color = '#';
  for (let i = 0; i < 6; i += 1) {
    color += letters[Math.floor(Math.random() * 16)];
  }
  return color;
};

const getRandomNumberGenerator = seed => {
  let localSeed = seed;
  return () => {
    localSeed += 1;
    const rnd = Math.sin(localSeed);
    return rnd - Math.floor(rnd);

gestalt

A set of React UI components which enforce Pinterest's design language

Apache-2.0
Latest version published 24 hours ago

Package Health Score

92 / 100
Full package analysis