question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v5 hashPrefix reasoning and not configurable

See original GitHub issue

Reproduction link

Edit on CodeSandbox

Steps to reproduce

This issue is for version 5, although not possible to select. “antd”: “5.0.0-rc.2”,

What is expected?

No hashPrefix is needed

What is actually happening?

A hashPrefix is used for all elements. This causes for larger dom as the className is long. For example, a button renders this additional classname. ant-btn css-dev-only-do-not-override-w9vaau ant-btn-primary

There is no need to include the ‘css-dev-only-do-not-override’ multiple and multiple times throughout the DOM.

What is the reasoning for using a hashPrefix? With a styled-components approach you can directly target elements as needed and styled-components adds a unique id to each element, so it doesn’t make much sense why one is included?

This is also not able to be switched off currently.

var hashPrefix =  true ? 'css-dev-only-do-not-override' : undefined;
Environment Info
antd 4.24.3
React 18
System 5
Browser 5

There are comments for the hashPrefix such as: // Generate different prefix to make user selector break in production env. // This helps developer not to do style override directly on the hash id.

Not sure what the use for this is without any documentation?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:3
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
github-actions[bot]commented, Nov 17, 2022

You may look for issues:

  1. 53% #16039

🤖 By issues-similarity-analysis

1reaction
zaneadixcommented, Dec 1, 2022

Awesome thank you @abenhamdine. I’ve upgraded and things are working as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading from AngularJS to Angular
You can make AngularJS services available for injection to Angular code by upgrading them. The same singleton instance of each service is shared...
Read more >
AngularJS: Developer Guide: Migrating from Previous Versions
If you actually want to have no hash-prefix, then you can restore the previous behavior by adding a configuration block to you application:...
Read more >
draft-ietf-openpgp-rfc4880bis-02 - OpenPGP Message Format
It does not deal with storage and implementation questions. ... In this case, the receiving implementation would try all available private keys, ...
Read more >
CHANGES.md.html · dune 3.4.0 · OCaml Packages
Allows to configure all the default destination directories with ./configure ... Do not generate META information for bigarray library in OCaml >= 5.0...
Read more >
Manual - LDAP Account Manager
Installation; LDAP Account Manager configuration; Setup sudo; Setup Perl ... Please note that LAM does not ship with a selinux policy. ... 5.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found