mirror of
https://github.com/apache/superset.git
synced 2026-04-10 20:06:13 +00:00
* 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
24 lines
533 B
JavaScript
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;
|