diff --git a/CHANGELOG.md b/CHANGELOG.md index 13eae5a..2120cdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. +## v1.7.11 + +- Replace usage of React's deprecated `defaultProps` ## v1.7.10 - Tweaks in type definitions for the `SQLEditor` component on the `blur` method diff --git a/package.json b/package.json index 32f8830..c465c11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/experimental", - "version": "1.7.10", + "version": "1.7.11", "description": "Experimental Grafana components and APIs", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/QueryEditor/Space.tsx b/src/QueryEditor/Space.tsx index 298bb9f..b97ef96 100644 --- a/src/QueryEditor/Space.tsx +++ b/src/QueryEditor/Space.tsx @@ -13,18 +13,20 @@ export interface SpaceProps { /** * @deprecated use the Space component from @grafana/ui instead. Available starting from @grafana/ui@10.4.0 */ -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 ; }; -Space.defaultProps = { - v: 0, - h: 0, - layout: 'block', -}; - const getStyles = (theme: GrafanaTheme2, props: SpaceProps) => ({ wrapper: css([ {