• The Zone component is a central part of the Zone component library. It uses the Zone SDK to dynamically render a "zone" of components that have been registered to a specific zone.

    The primary functionality of the Zone component is to render a SimpleZone, which is the default usage of this library. The SimpleZone uses the Zone SDK to dynamically render a "zone" of components that have been registered to a specific zone.

    Optionally, the Zone component can also render a PassThroughZone based on the passThrough prop. If passThrough is true, it renders a PassThroughZone and the original children after the PassThroughZone. In this case, the unrendered registered zone component configurations are provided to the cloned children on the components property. The author of these children will need to implement the rendering of the components themselves.

    Parameters

    • props: SimpleZoneProps

      The props for the component.

    • Optional context: any

    Returns ReactNode

    The rendered SimpleZone or PassThroughZone, and possibly the original children.

Properties

contextTypes?: ValidationMap<any>

Deprecated

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

See

Legacy React Docs

defaultProps?: Partial<SimpleZoneProps>

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'
}
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


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

MyComponent.displayName = 'MyAwesomeComponent'
propTypes?: WeakValidationMap<SimpleZoneProps>

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.