Closed fshowalter closed 1 year ago
Hey, I could be mistaken, but doesn't this line (https://github.com/TheMightyPenguin/dessert-box/blob/746e9ba797a58dd645a6945579de04341f16dad2/packages/react/src/index.ts#L104) mean the "as" prop will be spread to the rendered component? Prior to this it was destructured out (https://github.com/TheMightyPenguin/dessert-box/blob/e39aa98c535f6ef086f7d32c0a03bfbf1be75b86/packages/react/src/index.ts#L69) and not passed.
React seems happy to take the prop and renders it, so <Box as="span">Span Content</Box> renders <span as="span">Span Content</span>.
<Box as="span">Span Content</Box>
<span as="span">Span Content</span>
Which then triggers this kind of error in html validator: "Attribute as not allowed on element button at this point"
https://validator.w3.org/
@fshowalter @prncss-xyz just published 0.7.3 with this fix!
Hey, I could be mistaken, but doesn't this line (https://github.com/TheMightyPenguin/dessert-box/blob/746e9ba797a58dd645a6945579de04341f16dad2/packages/react/src/index.ts#L104) mean the "as" prop will be spread to the rendered component? Prior to this it was destructured out (https://github.com/TheMightyPenguin/dessert-box/blob/e39aa98c535f6ef086f7d32c0a03bfbf1be75b86/packages/react/src/index.ts#L69) and not passed.
React seems happy to take the prop and renders it, so
<Box as="span">Span Content</Box>
renders<span as="span">Span Content</span>
.