-
Notifications
You must be signed in to change notification settings - Fork 74
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
base: main
Are you sure you want to change the base?
Conversation
const auto &mutableChild = | ||
std::const_pointer_cast<TextInputShadowNode>(child); |
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.
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.
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.
This should be fine? Rerendering the decorator node should also rerender the text input underneath.
0edb26e
to
26f8433
Compare
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.Important
display: contents
is only supported on the new architecture. Merging this means dropping support for the old arch.Related Issues
GH_LINK
Manual Tests
Linked PRs