Files
superset2/superset/assets/javascripts/explorev2/components/controls/HiddenControl.jsx
Maxime Beauchemin e055e6d2c2 Fixing PropTypes warning messages (#2670)
* Fixing PropTypes warning message

React recently started warning on the upcoming deprecation of
React.PropTypes, the new approach is to use the `prop-types`
npm package instead.

* Fixing the tests
2017-04-24 17:39:57 -07:00

24 lines
533 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { FormControl } from 'react-bootstrap';
const propTypes = {
onChange: PropTypes.func,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
};
const defaultProps = {
onChange: () => {},
};
export default function HiddenControl(props) {
// This wouldn't be necessary but might as well
return <FormControl type="hidden" value={props.value} />;
}
HiddenControl.propTypes = propTypes;
HiddenControl.defaultProps = defaultProps;