How to use the prop-types.arrayOf function in prop-types

To help you get started, we’ve selected a few prop-types 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 assweeecan / antd_performance_test / app / scripts / containers / checkbox-page.jsx View on Github external
);
  }
}

CheckboxPage.defaultProps = {
  form: {},
  checkboxDataSource: [],
  checkbox2DataSource: [],

  init: () => undefined,
};

CheckboxPage.propTypes = {
  form: PropTypes.objectOf(PropTypes.func),
  checkboxDataSource: PropTypes.arrayOf(PropTypes.any),
  checkbox2DataSource: PropTypes.arrayOf(PropTypes.any),

  init: PropTypes.func,
};

function mapStateToProps(state) {
  return state.checkboxPage;
}

function mapDispatchToProps(dispatch) {
  return bindActionCreators(actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Form.create()(CheckboxPage));
github elastic / kibana / src / core_plugins / kibana / public / home / components / tutorial / instruction_set.js View on Github external
const instructionVariantShape = PropTypes.shape({
  id: PropTypes.string.isRequired,
  instructions: PropTypes.arrayOf(instructionShape).isRequired,
});

const statusCheckConfigShape = PropTypes.shape({
  success: PropTypes.string,
  error: PropTypes.string,
  title: PropTypes.string,
  text: PropTypes.string,
  btnLabel: PropTypes.string,
});

InstructionSetUi.propTypes = {
  title: PropTypes.string.isRequired,
  instructionVariants: PropTypes.arrayOf(instructionVariantShape).isRequired,
  statusCheckConfig: statusCheckConfigShape,
  statusCheckState: PropTypes.oneOf([
    StatusCheckStates.FETCHING,
    StatusCheckStates.NOT_CHECKED,
    StatusCheckStates.HAS_DATA,
    StatusCheckStates.NO_DATA,
    StatusCheckStates.ERROR,
  ]),
  onStatusCheck: PropTypes.func.isRequired,
  offset: PropTypes.number.isRequired,
  params: PropTypes.array,
  paramValues: PropTypes.object.isRequired,
  setParameter: PropTypes.func,
  replaceTemplateStrings: PropTypes.func.isRequired,
};
github hubiinetwork / hubii-core / src / containers / WalletManager / index.js View on Github external
);
  }
}

WalletManager.propTypes = {
  history: PropTypes.object.isRequired,
  match: PropTypes.object.isRequired,
  createWalletFromMnemonic: PropTypes.func.isRequired,
  saveLedgerAddress: PropTypes.func,
  saveTrezorAddress: PropTypes.func,
  createWalletFromPrivateKey: PropTypes.func.isRequired,
  createWalletFromKeystore: PropTypes.func.isRequired,
  loading: PropTypes.object.isRequired,
  createContact: PropTypes.func,
  contacts: PropTypes.oneOfType(
    [PropTypes.arrayOf(PropTypes.object), PropTypes.object]
  ),
  wallets: PropTypes.object.isRequired,
  intl: PropTypes.object.isRequired,
};

const mapStateToProps = createStructuredSelector({
  loading: makeSelectLoading(),
  contacts: makeSelectContacts(),
  wallets: makeSelectWallets(),
});

export function mapDispatchToProps(dispatch) {
  return {
    saveLedgerAddress: (...args) => dispatch(saveLedgerAddress(...args)),
    saveTrezorAddress: (...args) => dispatch(saveTrezorAddress(...args)),
    createWalletFromMnemonic: (...args) => dispatch(createWalletFromMnemonic(...args)),
github wavesplatform / wavesplatform.com / src / common / containers / Developers / lib / PictureBlock / index.jsx View on Github external
)}
    
  
);

PictureBlock.defaultProps = {
  align: 'left',
};

PictureBlock.propTypes = {
  text: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.arrayOf(PropTypes.string),
    PropTypes.node,
    PropTypes.arrayOf(PropTypes.node),
  ]),
};

export default injectSheet(styles)(PictureBlock);
github veritone / veritone-sdk / packages / veritone-widgets / src / widgets / EngineOutputExport / index.js View on Github external
]}
              />
            
          );
        })}
      
    );
  }
}

class EngineOutputExportWidgetComponent extends Component {
  static propTypes = {
    _widgetId: string.isRequired,
    tdos: arrayOf(
      shape({
        tdoId: string.isRequired,
        startOffsetMs: number,
        stopOffsetMs: number
      })
    ).isRequired,
    onExport: func.isRequired,
    onCancel: func
  };

  state = {
    open: false
  };

  open = () => {
    this.setState({
github joelpurra / talkie / src / options / containers / voices-container.jsx View on Github external
lang: PropTypes.string.isRequired,
                localService: PropTypes.bool.isRequired,
                name: PropTypes.string.isRequired,
                voiceURI: PropTypes.string.isRequired,
            })).isRequired
        ).isRequired,
        voicesByLanguageGroup: PropTypes.objectOf(
            PropTypes.arrayOf(PropTypes.shape({
                default: PropTypes.bool.isRequired,
                lang: PropTypes.string.isRequired,
                localService: PropTypes.bool.isRequired,
                name: PropTypes.string.isRequired,
                voiceURI: PropTypes.string.isRequired,
            })).isRequired
        ).isRequired,
        languages: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
        languageGroups: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
        languagesByLanguageGroup: PropTypes.objectOf(
            PropTypes.arrayOf(PropTypes.string.isRequired).isRequired
        ).isRequired,
        selectedLanguageCode: PropTypes.string,
        selectedVoiceName: PropTypes.string,
        effectiveVoiceNameForSelectedLanguage: PropTypes.string,
        sampleText: PropTypes.string,
        rateForSelectedVoice: PropTypes.number.isRequired,
        pitchForSelectedVoice: PropTypes.number.isRequired,
        isPremiumVersion: PropTypes.bool.isRequired,
    }

    render() {
        const {
            actions,
github bcgov / tfrs / frontend / src / notifications / NotificationsContainer.js View on Github external
Are you sure you want to delete this notification?
      ,
       this._updateNotifications({ ids: 'all', isRead: true })}
        id="confirmReadAll"
        key="modal-read-all"
        title="Confirm Mark all as Read"
      >
        Are you sure you want to mark all as read?
      
    ]);
  }
}

NotificationsContainer.propTypes = {
  items: PropTypes.arrayOf(PropTypes.shape()).isRequired,
  isFetching: PropTypes.bool.isRequired,
  updateNotifications: PropTypes.func.isRequired,
  getNotifications: PropTypes.func.isRequired,
  autoloadNotificationsEnable: PropTypes.func.isRequired,
  autoloadNotificationsDisable: PropTypes.func.isRequired
};

const mapStateToProps = state => ({
  isFetching: state.rootReducer.notifications.isFetching,
  items: state.rootReducer.notifications.items
});

const mapDispatchToProps = dispatch => ({
  updateNotifications: bindActionCreators(updateNotifications, dispatch),
  getNotifications: bindActionCreators(getNotifications, dispatch),
  autoloadNotificationsEnable: bindActionCreators(mountNotificationsTable, dispatch),
github Radarr / Radarr / frontend / src / Settings / Notifications / Notifications / Notifications.js View on Github external
/>

          
        
      
    );
  }
}

Notifications.propTypes = {
  isFetching: PropTypes.bool.isRequired,
  error: PropTypes.object,
  items: PropTypes.arrayOf(PropTypes.object).isRequired,
  onConfirmDeleteNotification: PropTypes.func.isRequired
};

export default Notifications;
github alibaba-fusion / next / src / transfer / view / transfer.jsx View on Github external
/**
         * 移动选项模式
         */
        mode: PropTypes.oneOf(['normal', 'simple']),
        /**
         * 数据源
         */
        dataSource: PropTypes.arrayOf(PropTypes.object),
        /**
         * (用于受控)当前值
         */
        value: PropTypes.arrayOf(PropTypes.string),
        /**
         * (用于非受控)初始值
         */
        defaultValue: PropTypes.arrayOf(PropTypes.string),
        /**
         * 值发生改变的时候触发的回调函数
         * @param {Array} value 右面板值
         * @param {Array} data 右面板数据
         * @param {Object} extra 额外参数
         * @param {Array} extra.leftValue 左面板值
         * @param {Array} extra.leftData 左面板数据
         * @param {Array} extra.movedValue 发生移动的值
         * @param {Object} extra.movedData 发生移动的数据
         * @param {String} extra.direction 移动的方向,值为'left'或'right'
         */
        onChange: PropTypes.func,
        /**
         * 是否禁用
         */
        disabled: PropTypes.bool,
github bcgov / tfrs / frontend / src / admin / fuel_codes / components / FuelCodesTable.js View on Github external
show={props.tooltips.show}
      target={() => props.tooltips.target}
      placement="top"
      container={this}
    >
      
        {props.tooltips.message}
      
    
  ]);
};

FuelCodesTable.defaultProps = {};

FuelCodesTable.propTypes = {
  items: PropTypes.arrayOf(PropTypes.shape({
    createUser: PropTypes.shape({
      organization: PropTypes.shape({
        name: PropTypes.string
      })
    }),
    status: PropTypes.shape({
      status: PropTypes.string
    })
  })).isRequired,
  isEmpty: PropTypes.bool.isRequired,
  isFetching: PropTypes.bool.isRequired,
  loggedInUser: PropTypes.shape({
    isGovernmentUser: PropTypes.bool
  }).isRequired,
  handleTooltip: PropTypes.func.isRequired,
  tooltips: PropTypes.shape({