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
[React] Remove string index fallback for CSS properties #24911
[React] Remove string index fallback for CSS properties #24911
Conversation
36ba488
to
8e9416d
Compare
@pelotom Thank you for submitting this PR! 🔔 @asvetliakov @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @JoshuaKGoldberg @jrakotoharisoa @flaub @alelode @UJosue10 @dawnmist @Ogglas @santiagodoldan @brmenchl @snerks @Havret - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@pelotom The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
Thanks! |
@johnnyreilly React supports CSS Custom Properties. What's our thoughts on this? Should we recommend module augmentation? |
@frenic Good catch, I didn't know about that feature. Module augmentation seems like the right approach... |
As a lightweight (if not type safe) alternative, you can always do this of course: <div style={{ ['--my-variable' as any]: 'red' }}>
...
</div> |
We've also lost ability to use pseudo types. |
@abelino inline styles can't use pseudo types... |
@abelino what @pelotom said with React inline styles OOTB. But if the types for a third party library relies on the index signature some how it could likely cause some problems.
@pelotom We should add a comment about that. I'll fix it. |
@abelino re. @-rules, if you’re using Material UI that should be fixed by mui/material-ui#11007 |
@pelotom thanks for that!!! |
Resolves #24568.
With csstype 2.2, the property list should hopefully be complete enough that we can remove the string index from
CSSProperties
.Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
.