Function default

  • default(props, context?): ReactNode
  • Parameters

    • props: MediaQueryProps
    • Optional context: any

    Returns ReactNode

Properties

Optional contextTypes

contextTypes?: ValidationMap<any>

Deprecated

Lets you specify which legacy context is consumed by this component.

See

Legacy React Docs

Optional defaultProps

defaultProps?: Partial<MediaQueryProps>

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

See

React Docs

Example

typeProps = { name?: string }

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

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

Optional displayName

displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.

See

Legacy React Docs

Example


constMyComponent: FC = () => {
return<div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'

Optional propTypes

propTypes?: WeakValidationMap<MediaQueryProps>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

Settings

Member Visibility

Theme

On This Page

Generated using TypeDoc

AltStyle によって変換されたページ (->オリジナル) /