-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CARE-5792] Fix - Rework Table element to not rely on context #89
[CARE-5792] Fix - Rework Table element to not rely on context #89
Conversation
Hey @yuriyyakym, I've reworked the approach to use the transformation as suggested. Looks much better now I think. |
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.
👍
export namespace TableCell { | ||
export type Node = TableCellNode & { isHeader: boolean }; |
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.
By the way, I had a similar challenge in the React emails project, and managed to solve it without extending the model:
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.
I wanted to do it the same way you did, by having a single Table component and rendering everything inside, but the problem was the way Renderer
component is implemented, where it iterates over every node in the document and then renders the component that matches.
I think in order to implement it like you did, we would have to change the whole renderer (or maybe change the Renderer
to only iterate over top-level nodes) and then have the top-level components render their children separately.
No description provided.