-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.If you are just getting started with Docusaurus, this issue should be a good place to begin.
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
The <Heading> component in docusaurus-theme-classic can be given a className prop:
<Heading as="h2" className="something">Hi!</Heading>However, the component's manual className=clsx(...) prop ignores props.className:
| <As | |
| {...props} | |
| className={clsx( | |
| 'anchor', | |
| hideOnScroll | |
| ? styles.anchorWithHideOnScrollNavbar | |
| : styles.anchorWithStickyNavbar, | |
| )} |
This means any className added in user-land is ignored.
Reproducible demo
Steps to reproduce
- Checkout that PR ->
yarn->yarn start - Change ...
to... - Observe that the site page does not center the heading text
Expected behavior
The className should be added to the clsx in Heading.
Actual behavior
The className is ignored.
Your environment
- Public source code: https://github.com/typescript-eslint/typescript-eslint
- Public site URL: https://typescript-eslint.io
- Docusaurus version used: 2.2.0, but the code isn't changed in latest
main - Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome 107, Node 16.18
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Monterey
Self-service
- I'd be willing to fix this bug myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.If you are just getting started with Docusaurus, this issue should be a good place to begin.