Boolean attribute rendering differs from Preact
See original GitHub issueHi,
Boolean attribute rendering seems to differ from Preact itself (4.8.0 at least).
For example with the JSX:
<div aria-hidden={true} />
preact: <div aria-hidden="true"></div>
preact-render-to-string: <div aria-hidden></div>
http://jsfiddle.net/28ckgyzj/1/ (see console log)
(With ARIA attributes presence doesn’t indicate truth as it does with the checked attribute for example).
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Boolean attribute rendering differs from Preact #4 - GitHub
Hi,. Boolean attribute rendering seems to differ from Preact itself (4.8.0 at least). ... (With ARIA attributes presence doesn't indicate truth as ...
Read more >API Reference | Preact: Fast 3kb React alternative with the ...
The render() function is required for all components. It can inspect the props and state of the component, and should return a Preact...
Read more >Using boolean-value of attributes in JSX - Stack Overflow
According to the HTML spec, there is no difference between data-enable-item=true and ...
Read more >Knowledge: Attributes and properties - Open Web Components
preact does some detection to see if a property exists on the element, and will set the property instead of the attribute. When...
Read more >Documentation - SolidJS · Reactive Javascript Library
assume this code is in a component function, so is part of a rendering ... The main difference is when you call the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the heads up @marvinhagemeister , that makes me confident to do the same workaround here as well. Will PR in a second
We did a change in core a while back for
aria
attributes specifically. They need to be handled differently.See https://github.com/preactjs/preact/pull/2347/files