Skip to content

Commit

Permalink
chore: migrate HiddenControl component from jsx to tsx (#17315)
Browse files Browse the repository at this point in the history
* migrate HiddenControl component from jsx to tsx

* Update superset-frontend/src/explore/components/controls/HiddenControl.tsx

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>

* updating the type of value in the interface

* Update superset-frontend/src/explore/components/controls/HiddenControl.tsx

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>

Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>
  • Loading branch information
Damans227 and Erik Ritter authored Nov 2, 2021
1 parent a2a457b commit 28b494c
Showing 1 changed file with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,14 @@
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import { Input } from 'src/common/components';

const propTypes = {
onChange: PropTypes.func,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.object,
PropTypes.bool,
PropTypes.array,
PropTypes.func,
]),
};

const defaultProps = {
onChange: () => {},
};
interface HiddenControlsProps {
onChange: () => void;
value: string | number | readonly string[] | undefined;
}

export default function HiddenControl(props) {
export default function HiddenControl(props: HiddenControlsProps) {
// This wouldn't be necessary but might as well
return <Input type="hidden" value={props.value} />;
}

HiddenControl.propTypes = propTypes;
HiddenControl.defaultProps = defaultProps;

0 comments on commit 28b494c

Please sign in to comment.