reactjs - Emotion/Styled 创建了大量独特的类名
问题描述
我正在使用 React 创建一个浏览器游戏,背景由单独的 Tile 组件组成。就我而言,这些往往具有相同的风格;
const BaseTile = styled.div`
width: 40px;
height: 40px;
position: absolute;
`;
但是,在每个 Tile 上,背景图像可能不同,并且变换值总是不同的。结果,Emotion/Styled 创建了大量的类名。我担心这可能会成为性能问题。对我的用例的任何建议将不胜感激。
解决方案
推荐阅读
- unity3d - 错误 CS0234:命名空间“UnityEngine.XR.WSA”中不存在类型或命名空间名称“WorldAnchor”(您是否缺少程序集引用?)
- python - 查找最后一个 input type="file"
- electron - 带有 Appx 缺少图标的电子构建
- c# - 给定一个轨迹和一个目标,我能否计算出将速度缩放多少才能击中目标?
- mysql - .NET Core 的 MySQL 性能
- android - 来自 RecyclerView 的 onClickListener 不起作用
- powershell - Azure 命令不会在 Powershell 中创建 AD 用户
- if-statement - 如果满足“else”部分,如何忽略“if”部分?
- javascript - 选择所有复选框进行编辑
- regex - 通过正则表达式排除除 ip 地址之外的所有内容