Skip to content

v0.7.7

Choose a tag to compare

@github-actions github-actions released this 06 Oct 12:59
· 121 commits to main since this release

Type a component's props from its catalog entry. ngx-json-render now re-exports core's InferComponentProps, InferCatalogComponents and InferActionParams, so the Zod schema in the catalog is the one place a component's props are declared.

import type { InferComponentProps } from 'ngx-json-render';
import type { catalog } from './catalog';

export class Card {
  readonly ctx = injectRenderContext<InferComponentProps<typeof catalog, 'Card'>>();
}

A field with a Zod .default() comes out required in the inferred type, but the renderer applies no defaults: the component still gets undefined when the spec leaves the field out. Wrap the type in Partial<…> or handle the missing value.

Upgrading

npm i ngx-json-render@^0.7.7

Types only, no runtime change. ngx-json-render-material@0.3.7 works with it.

Full Changelog: v0.7.6...v0.7.7