Open kylorhall-atlassian opened 6 months ago
Describe the bug
There's no type protection when consuming cssMap incorrectly, meaning TypeScript will allow code that won't compile properly.
cssMap
To Reproduce
For raw cssMap, jump into https://github.com/atlassian-labs/compiled/blob/master/packages/react/src/css-map/__tests__/index.test.tsx#L29 and remove .danger
.danger
-const Foo = () => <div css={styles.danger}>hello world</div>; +const Foo = () => <div css={styles}>hello world</div>;
Same, for the strict version: https://github.com/atlassian-labs/compiled/blob/f093635244ca5accecd5093013694084408be2f7/packages/react/src/create-strict-api/__tests__/index.test.tsx#L162
Expected behavior
These should both have a type error.
Screenshots
No error 😞
Thanks for raising this!
Describe the bug
There's no type protection when consuming
cssMap
incorrectly, meaning TypeScript will allow code that won't compile properly.To Reproduce
For raw
cssMap
, jump into https://github.com/atlassian-labs/compiled/blob/master/packages/react/src/css-map/__tests__/index.test.tsx#L29 and remove.danger
Same, for the strict version: https://github.com/atlassian-labs/compiled/blob/f093635244ca5accecd5093013694084408be2f7/packages/react/src/create-strict-api/__tests__/index.test.tsx#L162
Expected behavior
These should both have a type error.
Screenshots
No error 😞