How to use the react-sizeme.noPlaceholders function in react-sizeme

To help you get started, we’ve selected a few react-sizeme 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 artsy / reaction / src / Components / Publishing / index.tsx View on Github external
export { IconImageFullscreen } from "./Icon/IconImageFullscreen"
export { IconImageSet } from "./Icon/IconImageSet"
export { IconLayoutFullscreen } from "./Icon/IconLayoutFullscreen"
export { IconLayoutSplit } from "./Icon/IconLayoutSplit"
export { IconLayoutText } from "./Icon/IconLayoutText"
export { IconLayoutBasic } from "./Icon/IconLayoutBasic"
export { IconLink } from "./Icon/IconLink"
export { IconOrderedList } from "./Icon/IconOrderedList"
export { IconVideoPlay } from "./Icon/IconVideoPlay"
export { IconRemove } from "./Icon/IconRemove"
export { IconUnorderedList } from "./Icon/IconUnorderedList"
export { IconLock } from "./Icon/IconLock"

// FIXME: Refactor out SizeMe; see https://github.com/ctrlplusb/react-sizeme#server-side-rendering
import sizeMe from "react-sizeme"
sizeMe.noPlaceholders = true

// Constants
import * as AllConstants from "./Constants"
export const Constants = AllConstants
github Lattice-Automation / seqviz / config / jest / setup.js View on Github external
import Enzyme from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import sizeMe from "react-sizeme";
// import fetch from "jest-fetch-mock";
import "core-js/stable";
import "regenerator-runtime/runtime";

Enzyme.configure({ adapter: new Adapter() });

sizeMe.noPlaceholders = true;
// global.fetch = fetch;
localStorage.clear();
github IBM / carbon-addons-iot-react / src / index.js View on Github external
// Needed so that any component that uses sizeme can be jest tested
import sizeMe from 'react-sizeme';

sizeMe.noPlaceholders = true;

// Styles
export styles from './styles.scss';

// Components
export Button from './components/Button';
export Table from './components/Table';
export AddCard from './components/AddCard';
export ComposedModal from './components/ComposedModal';
export WizardModal from './components/WizardModal';
export WizardInline from './components/WizardInline/WizardInline';
export StatefulWizardInline from './components/WizardInline/StatefulWizardInline';
export TableHead from './components/Table/TableHead/TableHead';
export TableBody from './components/Table/TableBody/TableBody';
export TableToolbar from './components/Table/TableToolbar/TableToolbar';
export EmptyTable from './components/Table/EmptyTable/EmptyTable';
github IBM / carbon-addons-iot-react / config / jest / setup.js View on Github external
// Needed to mock resize observer
class ResizeObserver {
  observe() {
    // do nothing
  }
  unobserve() {
    // do nothing
  }
}

window.ResizeObserver = ResizeObserver;

// Needed so that any component that uses sizeme can be jest tested
import sizeMe from 'react-sizeme';

sizeMe.noPlaceholders = true;

// Force the timezone to be the same everywhere
const moment = require.requireActual('moment-timezone');
moment.fn.local = moment.fn.utc; // mock the local function to return utc
jest.doMock('moment', () => {
  moment.tz.setDefault('America/Chicago');
  return moment;
});
Date.prototype.getTimezoneOffset = () => 300; // mock date offset
Date.now = jest.fn(() => 1537538254000); // mock internal date
Date.prototype.getLocaleString = () => 'Mock Date!';
github cognitedata / griff-react / src / setupTests.ts View on Github external
import '@testing-library/jest-dom/extend-expect';
import sizeMe from 'react-sizeme';

sizeMe.noPlaceholders = true;

react-sizeme

Make your React Components aware of their width and/or height!

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis