Type alias AttrProps

AttrProps: {
    [attribute_name: string]: any;
}

the props used for explicitly declaring attributes on the output of ComponentGenerators.

Type declaration

  • [attribute_name: string]: any

Example

const CanvasComponent: ComponentGenerator<{
width?: number,
height?: number,
}> = ({ width = 300, height = 300 }) => <canvas width={width} height={height}>canvas is not supported</canvas>
const my_canvas = <CanvasComponent height={200} {...{
[ATTRS]: {
width: 400, // this later overrides the original value of `"300"` set by default.
style: "background-color: green;", // assign a new attribute node for a green background.
} as AttrProps
}}>ddd</CanvasComponent>

Generated using TypeDoc