Skip to content
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

docs: update workarounds for sub-components with Next.js App router #46711

Merged

Conversation

navidmafi
Copy link
Contributor

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

workaround for vercel/next.js#51593

💡 Background and solution

Using subcomponents of components (like Typography in Next.js app router causes an error that tells that client components are not dottable on the server.
The current proposed fix is just to make the page fully client-rendered which works well as a workaround but is less than optimal since by making the component fully client-rendered developers can't use SSR patterns if they want to.

The new workaround that I'm proposing here is to extract the needed subcomponents into client components which allows for usage is SSR pages.

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Signed-off-by: Navid <navidmafi2006@gmail.com>
Copy link

stackblitz bot commented Dec 30, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Dec 30, 2023

Visual Regression Report for PR #46711 Passed ✅

Target branch: master (be447df)


Congrats! No visual-regression diff found

Copy link
Contributor

github-actions bot commented Dec 30, 2023

Preview Is ready

Copy link

codesandbox-ci bot commented Dec 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dc6a10d:

Sandbox Source
antd reproduction template (forked) Configuration

…router

Signed-off-by: Navid <navidmafi2006@gmail.com>
@navidmafi
Copy link
Contributor Author

Added zh-CN translation using Machine translation (DeepL). Please let me know if any part is wrongly translated.

docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
Signed-off-by: Amumu <yoyo837@hotmail.com>
docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
Signed-off-by: Amumu <yoyo837@hotmail.com>
Signed-off-by: Amumu <yoyo837@hotmail.com>
Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f4822ac) 100.00% compared to head (5a6b467) 100.00%.
Report is 1 commits behind head on master.

❗ Current head 5a6b467 differs from pull request most recent head dc6a10d. Consider uploading reports for the commit dc6a10d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            master    #46711    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          721       708    -13     
  Lines        12879     12122   -757     
  Branches      3427      3220   -207     
==========================================
- Hits         12879     12122   -757     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
Signed-off-by: lijianan <574980606@qq.com>
docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
Signed-off-by: lijianan <574980606@qq.com>
docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
Signed-off-by: lijianan <574980606@qq.com>
Signed-off-by: lijianan <574980606@qq.com>
Signed-off-by: lijianan <574980606@qq.com>
docs/react/faq.zh-CN.md Outdated Show resolved Hide resolved
Signed-off-by: lijianan <574980606@qq.com>
@li-jia-nan li-jia-nan merged commit 15f797d into ant-design:master Dec 30, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants