-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMP: hidden attribute on amp elements causes a validation error #8861
Comments
How about instead empty string? import Head from 'next/head';
export const config = { amp: true };
const Index = () => (
<amp-img hidden="" src="https://unsplash.it/300/200" width="300" height="200"></amp-img>
<div hidden>Test</div>
);
export default Index; |
@c0b41 thanks, that's a good workaround! However, I find the inconsistent serialization behavior confusing. |
Note this semi-conflicts with the React team's plan with the facebook/react#16831 |
I'm not sure this is something Next.js should really try to "patch", as its just a gotcha with JSX. |
I agree. Just found the related react issue. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
Using AMP's built-in
hidden
attribute on an AMP element results in a validation error:The problem is that
hidden
is converted intohidden=true
which causes the validation error above. Usinghidden
on a non-AMP element works though (e.g.<div hidden>
).To Reproduce
This will cause a validation error:
Expected behavior
The hidden attribute should be supported on AMP elements.
System information
The text was updated successfully, but these errors were encountered: