How to use the react.PropTypes.object function in react

To help you get started, weโ€™ve selected a few react 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 nylas-mail-lives / nylas-mail / packages / client-app / internal_packages / composer-mail-merge / lib / mail-merge-participants-text-field.jsx View on Github external
}),
}


class MailMergeParticipantsTextField extends Component {
  static displayName = 'MailMergeParticipantsTextField'

  static containerRequired = false

  static propTypes = {
    onAdd: PropTypes.func,
    onRemove: PropTypes.func,
    field: PropTypes.string,
    session: PropTypes.object,
    className: PropTypes.string,
    sessionState: PropTypes.object,
    draftClientId: PropTypes.string,
    mailMergeSession: PropTypes.object,
  }

  static defaultProps = {
    className: '',
  }

  constructor(props) {
    super(props)
    this._tokenWasMovedBetweenFields = false
  }

  // This is called by the TokenizingTextField when a token is dragged and dropped
  // between fields
  onAddToken = (...args) => {
github dtysky / BlogReworkPro / Front / src / app.js View on Github external
import actionTypes from './actions';
import {
    NavBar, MenuPC, MenuPhoneHeader, MenuPhoneFooter, LeftImage, MusicPlayer
} from './components';

import './theme/css/sky.less';
import './theme/css/main.less';


@connect(
    (state) => ({...state}) // mapStateToProps
)
export default class APP extends Component {
    static propTypes = {
        params: PropTypes.object,
        content: PropTypes.object,
        component: PropTypes.func,
        dispatch: PropTypes.func,
        articleList: PropTypes.object,
        theme: PropTypes.object,
        headInfo: PropTypes.object,
        music: PropTypes.object
    };

    static defaultProps = {};

    changeThemeToDefault() {
        const {dispatch, theme} = this.props;
        if (!theme.get('current').equals(theme.get('default'))) {
            dispatch({type: actionTypes.change.theme.default});
        }
    }
github pdaddyo / soundbounce-v2 / src / components / player / SpotifyPlayerStatus.js View on Github external
import React, {Component, PropTypes} from 'react';
import {connect} from 'react-redux';
import Title from '../track/Title';
import Artists from '../track/Artists';
import classes from './playerStatus.css';

class SpotifyPlayerStatus extends Component {
	static propTypes = {
		player: PropTypes.object
	};

	render() {
		const {player} = this.props;
		// no player state so return nothing
		if (!player || !player.item || !player.is_playing) {
			return null;
		}

		const {images} = player.item.album;
		const artwork = images ? `url(${images[images.length > 1 ? 1 : 0].url})` : 'none';

		return (
			<div>
				<div>
					<div></div></div></div>
github appirio-tech / connect-app / src / projects / list / components / ProjectList / ProjectList.jsx View on Github external
const ProjectList = (({ projects }) =&gt; {

  const renderProject = (project, idx) =&gt; {
    return ()
  }

  return (
    <div>
      
      { projects.map(renderProject) }
    </div>
  )
})

ProjectList.propTypes = {
  projects: PropTypes.arrayOf(PropTypes.object).isRequired
}

export default ProjectList
github openforis / collect / collect-web / collect-webapp / frontend / vendor / recharts / src / chart / generateCategoricalChart.js View on Github external
static displayName = getDisplayName(ChartComponent);

    static propTypes = {
      syncId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
      width: PropTypes.number,
      height: PropTypes.number,
      data: PropTypes.arrayOf(PropTypes.object),
      layout: PropTypes.oneOf(['horizontal', 'vertical']),
      stackOffset: PropTypes.oneOf(['sign', 'expand', 'none', 'wiggle', 'silhouette']),
      margin: PropTypes.shape({
        top: PropTypes.number,
        right: PropTypes.number,
        bottom: PropTypes.number,
        left: PropTypes.number,
      }),
      style: PropTypes.object,
      className: PropTypes.string,
      children: PropTypes.oneOfType([
        PropTypes.arrayOf(PropTypes.node),
        PropTypes.node,
      ]),
    };

    static defaultProps = {
      layout: 'horizontal',
      stackOffset: 'none',
      margin: { top: 5, right: 5, bottom: 5, left: 5 },
    };

    constructor(props) {
      super(props);
      this.state = this.createDefaultState(this.props);
github pubpub / pubpub / app / containers / Journal / Journal.js View on Github external
import JournalPage from './JournalPage';
import JournalPages from './JournalPages';
import JournalPeople from './JournalPeople';
import JournalSubmits from './JournalSubmits';
import LayoutRenderer from 'components/LayoutEditor/LayoutRenderer';
import Link from 'components/Link/Link';
import NoMatch from 'containers/NoMatch/NoMatch';
import Radium from 'radium';
import { connect } from 'react-redux';
import { getJournalData } from './actions';

let styles;

export const Journal = React.createClass({
	propTypes: {
		accountData: PropTypes.object,
		journalData: PropTypes.object,
		params: PropTypes.object,
		location: PropTypes.object,
		dispatch: PropTypes.func,
	},

	getInitialState: function() {
		return {
			logo: undefined,
			headerColor: '',
			headerMode: '',
			headerAlign: '',
			headerImage: '',
		};
	},
github HubSpot / Blazar-Archive / BlazarUI / app / scripts / components / org / OrgContainer.jsx View on Github external
);
  }
}

OrgContainer.propTypes = {
  params: PropTypes.object.isRequired
};

export default OrgContainer;
github javascriptair / site / src / pages / episode / index.js View on Github external
) : ''
      }
      <hr>
      
      <hr>
      
      <hr>
      
    
  )
}

PastEpisodeStuff.propTypes = {
  episodeData: PropTypes.object,
  sponsors: PropTypes.object,
}

function FutureEpisodeStuff({episodeData, sponsors}) {
  const {styles} = FutureEpisodeStuff
  const {youTubeId, calendarUrl} = episodeData
  return (
    <div>
      {
        youTubeId ? (
          <div>
            <hr>
            <div>
              </div></div></div>
github cdebotton / react-universal / src / containers / Client.js View on Github external
import React, {Component, PropTypes} from 'react';
import {Router} from 'react-router';
import routes from '../routes';

export default class Client extends Component {
  static propTypes = {
    history: PropTypes.object.isRequired,
  }

  render() {
    return (
      
        {routes}
      
    );
  }
}
github wri / gfw-mapbuilder / src / js / components / TabPanel / InfoWindow.js View on Github external
import {defaultColorTheme} from '../../config';
import mapActions from '../../actions/MapActions';
import MapStore from '../../stores/MapStore';

import React, {
  Component,
  PropTypes
} from 'react';

let layersCategories = {};

export default class InfoWindow extends Component {
  static contextTypes = {
    language: PropTypes.string.isRequired,
    map: PropTypes.object.isRequired,
    settings: PropTypes.object.isRequired
  };

  constructor(props) {
    super(props);
    this.state = {
      activeSelectedFeature: '',
      prevButtonHover: false,
      nextButtonHover: false,
      ...MapStore.getState()
    };
  }
  
  componentDidMount() {
    MapStore.listen(this.storeDidUpdate);
  }