-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-docs: Fix React Suspense in source snippets. #19787
Addon-docs: Fix React Suspense in source snippets. #19787
Conversation
Refactored PR: #19785 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this @zhyd1997 !! Is there a full list of these "known symbols" somewhere & can we do all of them in this PR?
expect(renderJsx(createElement(SuspenseComponent, {}, 'I am Suspense'), {})) | ||
.toMatchInlineSnapshot(` | ||
<SuspenseComponent> | ||
I am Suspense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas why the <div>
is not showing up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhh, div
, sorry, it's my problem, I will add it when I come back my office.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually It works for new creat-react-app when I added them in bundled code, I will figure out why the test passed with wrong snapshot.
Hi @shilman! with the help of @JReinhold on Discord, I have fixed the CI errors on PR #19785
so could we talk about the feature/bug on PR #19785 ? Update:
I think it's related to Reproduce: import React, { createElement } from 'react';
import reactElementToJSXString from 'react-element-to-jsx-string';
function SuspenseComponent(props: any) {
return (
<React.Suspense fallback={null}>
<div>{props.children}</div>
</React.Suspense>
);
}
console.log(reactElementToJSXString(createElement(SuspenseComponent, {}, 'I am Suspense'), {}));
// -------- log ----------
<SuspenseComponent>
I am Suspense
</SuspenseComponent> |
@zhyd1997 Is the other PR a replacement for this one? Can I close this PR, then? |
Hi @ndelangen The replacement: #19785 |
Issue: #11554
What I did
add
<React.Suspense>
support in `source snippets.How to test
If your answer is yes to any of these, please make sure to include it in your PR.