Releases: pveyes/htmr
Releases · pveyes/htmr
v1.0.2
v1.0.1
Fix non-boolean attribute treatment #138
Previously these HTML trigger react warning because it satisfies boolean attribute value requirement (value equals to attribute name, or empty string).
<img alt="alt" />
<div class=""></div>
It's rendered into
// jsx equivalent
<img alt={true} />
<div className={true}></div>
Now htmr will validate whether the attribute is boolean attribute before using boolean value. If not, the attribute will simply be forwarded as is
Example above now rendered as
// jsx equivalent
<img alt="alt" />
<div className=""></div>
v1.0.0
v0.10.0
v0.9.2
v0.9.1
v0.9.0
- exported
HtmrOptions
as top-level named export
import { HtmrOptions } from 'htmr'
- Better props type annotation for transform
const transform: HtmrOptions = {
a: props => {
// props is now automatically inferred
if (props.href.startsWith('http') {
}
}
}
- SVG tags support
const transform: HtmrOptions = {
svg: props => {
return <>{props.viewBox}</>
}
}
- Fixed type definition for default transform return value
- Fixed
viewBox
warning when renderingsvg
element