-
Notifications
You must be signed in to change notification settings - Fork 9
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
Code example generator [LG-2954, LG-2950, LG-2951] #259
Conversation
let isRootSet = false; | ||
let componentRoot: ReactElement<any> = renderedStory; | ||
|
||
// @ts-expect-error - prepass callback args are incorrectly typed. Need to explicitly re-type them |
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.
is there an open issue on their side that we can reference here?
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 is now FormidableLabs/react-ssr-prepass#86
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.
Though the last commit to that repo was over a year ago, so no guarantees it gets in. I could try and find another library that does the same, but in my research, the other options were even more out-of-date.
(another option would be to port over the code and maintain it ourselves, but that doesn't feel right to me)
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.
Will approve once Table bug is addressed!
Traverses the rendered example component in the ReactTree to find the relevant component, then generates the JSX string from that component.
To Test:
Link this branch: mongodb/leafygreen-ui#1700
Rebuild packages (
yarn build
) and docs (yarn docs:tsdoc
)