Skip to main content

defaultProps

@elastic/chartsExports


@elastic/charts / Metric / defaultProps

Variable: defaultProps?

defaultProps?: undefined | Partial<SFProps<MetricSpec, "chartType" | "specType", "data", never, "id">>

Used to define default values for the props accepted by the component.

See

React Docs

Example

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}

Deprecated

Use values for destructuring assignments instead.

Source

node_modules/@types/react/index.d.ts:1179


Generated using typedoc-plugin-markdown and TypeDoc