09-advanced/06-dynamic-props.tsx
Dynamic Props
Example
Official Cake20 View example for dynamic props.
export const data = {
name: "aria-label",
value: "Light the candle",
attrs: {
class: "rounded px-4 py-2",
disabled: false,
},
};
export default () => (
<button {...data.attrs} {...{ [data.name]: data.value }}>
Start
</button>
);