Skip to main content

defaultProps

@elastic/chartsExports


@elastic/charts / RectAnnotation / defaultProps

Variable: defaultProps?

defaultProps?: undefined | Partial<SFProps<RectAnnotationSpec, "chartType" | "specType", "zIndex" | "groupId" | "annotationType" | "outside", SFOptionalKeys<RectAnnotationSpec, "chartType" | "specType", "zIndex" | "groupId" | "annotationType" | "outside">, SFRequiredKeys<RectAnnotationSpec, "chartType" | "specType", "zIndex" | "groupId" | "annotationType" | "outside", SFOptionalKeys<RectAnnotationSpec, "chartType" | "specType", "zIndex" | "groupId" | "annotationType" | "outside">>>>

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