Skip to content

Commit

Permalink
remove defaultProps usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ashharrison90 committed May 14, 2024
1 parent f75c060 commit 8fef2a8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/QueryEditor/Space.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ export interface SpaceProps {
/**
* @deprecated use the Space component from @grafana/ui instead. Available starting from @grafana/[email protected]
*/
export const Space = (props: SpaceProps) => {
const styles = useStyles2(useCallback((theme) => getStyles(theme, props), [props]));
export const Space = ({
v = 0,
h = 0,
layout = 'block',
}: SpaceProps) => {
const styles = useStyles2(useCallback((theme) => getStyles(theme, {
v,
h,
layout,
}), [v, h, layout]));

return <span className={cx(styles.wrapper)} />;
};

Space.defaultProps = {
v: 0,
h: 0,
layout: 'block',
};

const getStyles = (theme: GrafanaTheme2, props: SpaceProps) => ({
wrapper: css([
{
Expand Down

0 comments on commit 8fef2a8

Please sign in to comment.