We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
px
We've noticed a discrepancy in how preact / react server renders a component that looks like this:
import React from "preact/compat"; import "./styles.css"; export default function App() { return ( <div style={{ display: "grid", "grid-column-gap": 16, "grid-row-gap": 24, border: "1px solid red" }} > <div className="child">Child</div> <div className="child">Child</div> <div className="child">Child</div> <div className="child">Child</div> </div> ); }
Code sandboxes for preact and react to compare the output:
We're using React 16.14.0 but as far as I can tell, React 17.x would have the same discrepancy.
I think the difference is that in Preact, we use this regex:
IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
Which would match grid-gap, but React explicitly lists non dimensional properties: https://github.com/facebook/react/blob/v17.0.0/packages/react-dom/src/shared/CSSProperty.js#L11
grid-gap
So properties that would be non dimensional in Preact but not React are:
There might be more, it might be worth auditing gap properties fully to ensure there aren't more discrepancies
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
We've noticed a discrepancy in how preact / react server renders a component that looks like this:
Code sandboxes for preact and react to compare the output:
We're using React 16.14.0 but as far as I can tell, React 17.x would have the same discrepancy.
I think the difference is that in Preact, we use this regex:
Which would match
grid-gap
, but React explicitly lists non dimensional properties: https://github.com/facebook/react/blob/v17.0.0/packages/react-dom/src/shared/CSSProperty.js#L11So properties that would be non dimensional in Preact but not React are:
There might be more, it might be worth auditing gap properties fully to ensure there aren't more discrepancies
The text was updated successfully, but these errors were encountered: