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

Replace the commit hook with a wrapper component based on display: contents #566

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

j-piasecki
Copy link
Collaborator

Details

React Native 0.77 comes with support for display: contents which would allow to make a wrapper component that doesn't impact layout in any way. This can be used to replace the commit hook to apply markdown styles without cloning the tree.

Related Issues

GH_LINK

Manual Tests

Linked PRs

Comment on lines +78 to +79
const auto &mutableChild =
std::const_pointer_cast<TextInputShadowNode>(child);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here (not specifically these lines, in general) assumes that if the decorator node is mutable, the child text input is also mutable. I'm not actually sure whether this assumption always holds true.

It may make sense to check the children in the constructor and clone them if fragment.children is null and the children list is not empty to ensure the child is mutable.

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.

1 participant