How to use the react-portal.propTypes function in react-portal

To help you get started, we’ve selected a few react-portal 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 bcrumbs / reactackle / packages / reactackle-autoposition / src / AutoPosition.js View on Github external
/**
   * Set positioning priority template
   */
  slidePriority: PropTypes.arrayOf(
    PropTypes.oneOf([
      'slideOnCurrentEdge',
      'slideOnOppositeEdge',
      'slideOnAdjacentEdge',
      'changeType',
    ]),
  ),
  /**
   * Specify function to call on overflow
   */
  onOverflow: PropTypes.func,
  ...Portal.propTypes,
  children: PropTypes.oneOfType([
    PropTypes.func,
    PropTypes.element,
  ]).isRequired,
};

const defaultProps = {
  parent: window,
  wrapper: window,
  positionStyle: 'absolute',
  visible: false,
  positionX: 'left',
  positionY: 'top',
  type: 'inner',
  direction: 'horizontal',
  overflowMargin: -5,
github bcrumbs / reactackle / packages / reactackle-autoposition / src / AutoPosition.js View on Github external
/**
 * @author Dmitriy Malakhov
 */

'use strict';

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Portal from 'react-portal';
import pick from 'lodash.pick';
import throttle from 'lodash.throttle';

import { noop } from 'reactackle-core';

const SCROLL_THROTTLE_DELAY = 20;
const keysPortalPropTypes = Object.keys(Portal.propTypes);

const propTypes = {
  /**
   * Define the element to which the component will be positioned
   */
  parent: PropTypes.object,
  /**
   * Define boundaries to which the component will be positioned
   */
  wrapper: PropTypes.object,
  /**
   * Determines css position property. We recommend to use 'absolute'
   * positioning as it requires less calculations and is more effective.
   */
  positionStyle: PropTypes.oneOf(['fixed', 'absolute']),
  /**

react-portal

To make your life with React Portals easier.

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis